I have a sheet with 240*4 data (rows and columns). I want to sort cells of each rows randomly. For example if the orginal libre office sheet is as below:
aaa bbb ccc dddd
fff hhh kkk llll
ccc bbb ggg pppp
I would like to get:
bbb aaa ddd ccc
kkk hhh fff lll
ggg ccc ppp bbb
I found lots of solutions about how to sort full rows (the row number 1 with 3 or 2 ) but I did not find anything about how I can sort the cells in each row using libra office. Could you please help me?
Best
I think that the LibreOffice/OpenOffice Calc extension Permutate! will help you. Download and install from https://sourceforge.net/projects/permutate/
Related
I'm a novice creating OBIEE analysis. I searched this site looking for an answer and can't find the exact one I need.
Is there a way to capture unique IDs from one column that have two different results in another column?
How do I capture the Employee IDs that have two different ticket numbers?
ID Ticket Result
123 201 Hired
123 301 Retired
456 201 Hired
789 317 Resigned
888 210 Temp Hire
777 249 Seasonal Hire
666 209 Hired PT
666 310 Removed
456 339 Death
Expected results:
123
666
456
When I have an "order by" clause inside of a hive query, for example:
SELECT *
FROM categories
ORDER BY category_name
The results will be sorted as all the capital letters first and then all the lower letters. I need some table constraint or configuration to enforce the below behavior. A session sorting with UPPER/LOWER won't help.
Current results:
AAA
KKK
ZZZ
aaa
bbb
yyy
Expected results:
aaa
AAA
bbb
KKK
yyy
ZZZ
Is there any configuration which enforces hive to sort the data Alphabetical sorting first?
Within sql it's a collation. Within oracle it's LTS.
What is the right configuration for this kind of expected sorting results, and where to set it?
How about just using lower()?
SELECT *
FROM categories
ORDER BY LOWER(category_name);
Note: this will be arbitrary about the case of the result. Because lower-case letters come after upper case in all modern collations, you could do:
SELECT c.*
FROM categories c
ORDER BY LOWER(c.category_name), c.category_name DESC;
In order to implement the alphabetical sorting or any kind of sorting you can use cluster by in your query.
SELECT *
FROM categories
cluster BY LOWER(category_name);
You can alternatively use the distribute by with sort by option for more customized solution.
SELECT *
FROM categories
DISTRIBUTE BY LOWER(category_name)
SORT BY LOWER(category_name) DESC
I have a table with 6 locations with staff allocated to an office. How do I display them in a table windows forms with the column name but not display if empty. If I had the following.
office1 office2 office3 office4 office5 office 6
------- ------- ------- ------- ------- --------
Dave Bob Ed
Alan Jeff John
Tom
Suppose we have a HIVE table like this
name id age
jones 12 34
george joseph 13 45
bush 15 23
Now i want to output this hive table to csv and pipe separated file.
I followed steps in How do I output the results of a HiveQL query to CSV?.
hive -e 'select books from table' | sed 's/[[:space:]]\+/,/g' > /home/lvermeer/temp.csv
But its working this these
name id age
jones 12 34
george joseph 13 45
bush 15 23
I want george joseph to be in 1 column. Since george joseph contains middle spaces, its outputting to next column. How to resolve this problem ??
In case your query doesnt contain join or so criterias then You could easily get the data from the corresponding HDFS location. The data would be |(pipe) seperated as per the delimiters mentioned.
Hive columns are separated by '\t', assuming "george" and "joseph" are separated by space, you don't have any problems. You can check out separators with vim, just type :set list. Tabs would be marked as ^I
To view output file, you can use, for example, LibreOffice Calc, but you have to be sure, that you are using as delimiters only tabs, not spaces
I would like to generate view
CUSTOMER, CUSTOMER_ID, PRODUCTS
ABC INC 1 A=XYX, B=ZZZ
DEF CO 2 A=XYX, B=ZZZ, C=WWW
GHI LLC 3 B=ZYX
Would like the view to be something like
CUSTOMER, CUSTOMER_ID, A B C
ABC INC 1 XYX ZZZ
DEF CO 2 XYX ZZZ WWW
GHI LLC 3 ZYX
I was wondering if there is way to do this in oracle is fast and efficient way. I know it can might be done with PLSQL or with some logic. Concern here is mainly performance as I need to pull data every 10 minutes from tables that have enormous amounts of data and don't want the view query to take more than that.
Any ideas or suggestions?
Thanks,
Tam
is there always just A, B and C ? if so, use substr and instr
As Matthew says it's really just a simple matter of string functions to isolate those values, but if you expect to be able to query the view with predicates such as B=XYZ then you're going to have to look into adding function-based indexes on the underlying tables.