Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all
i have data like attached below
Col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 | col9 | col10 |
a | 1 | x | 4 | d | 7 | g | xyz | aa | 0 |
b | 2 | y | 5 | e | 8 | h | xyz | bb | 0 |
c | 3 | z | 6 | f | 9 | i | xyz | cc | 0 |
in script level itself i need to convert my data like i attached below
Col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 | col9 | col10 |
a | 1 | x | 4 | d | 7 | g | xyz | aa | 0 |
Col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 | col9 | col10 |
b | 2 | y | 5 | e | 8 | h | xyz | bb | 0 |
Col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8 | col9 | col10 |
c | 3 | z | 6 | f | 9 | i | xyz | cc | 0 |
any idea!!!!
thanks
just reload the table once stacked with loading 1 st row then 2nd row ......etc
Or just do a trick of concatenating more than one table
hi sujeet,
thanks alot for ur kind reply.
will u plz explain me a bit detailed please
thnx
Hi ,
Like this
Qualify *;
Table1:
Loald *
From YourSource
Where Col1='a';
Table2:
Loald *
From YourSource
Where Col1='b';
Table3:
Loald *
From YourSource
Where Col1='c';
UnQualify *;
Note: If you don't use Qualify, Auto concatenation will happen.
If you use noConcatenate, Synthetic keys will create in your model.
Hope it helps you..!
hi ravi,
i cant use where col1='a' somthing like that. because it may be anything and of i have 100000 rows i cant do one by one rite.
please suggest is thr any other way to achieve my desired result
thnx
Pls explain..
Are Col1,col2,col3.... field names?
IF Col1, col2,... are field names, do u want the field name to be long with data in the alternate rows? or u want to have different tables with the fileds col1, col2,... with only one row each.?
If so y do u need it in that format? How are u planning to show data with the field names inside the data.
Or
are these col1, col2... are just data?
-Sundar
hi sundar,
col1, col2, col3 are field name
do u want the field name to be long with data in the alternate rows?
Yes i need to show field name infront of each and every row
Y so? How are u planing to show data in the dashboard with the field names mingled in along with the data.?
What would be the purpose of inserting the field names into the data? can u pls explain
-sundar
Ur requrirementr can be done with a for loop and cancatenation.
This could be dont in the following way.
1. create a new key in the table as below
rowno() as newkey
table1:
load col1,col2,
rowno() as newkey
from source;
2.now create an inline table with the same field names, but the data as the field names itself.
table2:
load * inline
[col1,col2,newkey
col1,col2,newkey];
3.now load only one row of data from table 1 and concatenate to table2
4.concat table2
5.load the second row from table1 and concatenate to table2
6. concat table2
7. for loop can be written to repeat 3,4,5,6,....
8. after loading it in the desired format, drop table1.
Hope this helps.
-Sundar
hi sundar,
thnk u very much for ur reply. i am very new to qlikview. will you please share me the script. how exactly we can do it..
thnaks