Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a following simple table:
Months|Sales|Profit
Jan | 1M | 100K
Feb | 2M | 200K
March | 3M | 300K
How can rotate it in QLIK Sense that at the end it will look like this:
Jan | Feb |March
Sales 1M | 2M | 3M
Profit 100 | 200K |300K
Thanks in Advance
OK
attahced, a new way :
Data:
LOAD * INLINE [
Months, Sales, Profit
Jan, 1M , 100K
Feb ,2M , 200K
March , 3M , 300K
];
let NumRows=NoOfRows('Data');
Let vcount =NoOfFields('Data');
FOR i=0 to $(NumRows)-1
For j=2 to $(vcount)
LET Value=Peek(FieldName($(j),'Data'),$(i),'Data');
let title=Peek(FieldName(1,'Data'),$(i),'Data');
let title2=FieldName($(j),'Data');
load
'$(title2)' AS Title,
'$(Value)' as '$(title)'
autogenerate(1);
NEXT;
NEXT;
drop table Data;
I have a similar set of query , could you please help me with the below scenario :-
UserID | UserNumber | Feedback YN | Question |
29 | 11111111 | YES | Q1) Did you completed the day one activities ? |
30 | 11111111 | YES | Q2)Did you share the infomration with customer ? |
31 | 11111111 | N/A | Q3) Did you escalate if required ? |
32 | 11111111 | YES | Q4Did you follow the closure process ? |
And I wish to achieve the below output :-
UserID | User Number | Q1) Did you completed the day one activities ? | Q2)Did you share the information with customer ? | Q3) Did you escalate if required ? | Q4) Did you follow the closure process ? |
29 | 11111111 | YES | |||
30 | 11111111 | YES | |||
31 | N/A | ||||
32 | Yes |
I tried your solution but I could not able to do it correctly with my data as I need the other fields as well. Could you please help me with this ?
I cannot use the generic load solution here as it results in creation of multiple tables and synthetic keys .
Thanks
attached
LOAD
*
FROM [lib://Downloads/test1683696.xlsx]
(ooxml, embedded labels, table is Feuil2, filters(
Rotate(right)
));
Thanks !
i load from a resident table though and it seems not working . Can i run this rotate(right) command with a load from a resident table ?
Thanks in advance
Vladimir
OK
attahced, a new way :
Data:
LOAD * INLINE [
Months, Sales, Profit
Jan, 1M , 100K
Feb ,2M , 200K
March , 3M , 300K
];
let NumRows=NoOfRows('Data');
Let vcount =NoOfFields('Data');
FOR i=0 to $(NumRows)-1
For j=2 to $(vcount)
LET Value=Peek(FieldName($(j),'Data'),$(i),'Data');
let title=Peek(FieldName(1,'Data'),$(i),'Data');
let title2=FieldName($(j),'Data');
load
'$(title2)' AS Title,
'$(Value)' as '$(title)'
autogenerate(1);
NEXT;
NEXT;
drop table Data;
Hi,
That seems almost there. Can you just show how to put the results in one new table instead of having it in Autogenerate(1), Autogenerate(1) - 1, Autogenerate(1) - 2
Thanks
I have a similar set of query , could you please help me with the below scenario :-
UserID | UserNumber | Feedback YN | Question |
29 | 11111111 | YES | Q1) Did you completed the day one activities ? |
30 | 11111111 | YES | Q2)Did you share the infomration with customer ? |
31 | 11111111 | N/A | Q3) Did you escalate if required ? |
32 | 11111111 | YES | Q4Did you follow the closure process ? |
And I wish to achieve the below output :-
UserID | User Number | Q1) Did you completed the day one activities ? | Q2)Did you share the information with customer ? | Q3) Did you escalate if required ? | Q4) Did you follow the closure process ? |
29 | 11111111 | YES | |||
30 | 11111111 | YES | |||
31 | N/A | ||||
32 | Yes |
I tried your solution but I could not able to do it correctly with my data as I need the other fields as well. Could you please help me with this ?
I cannot use the generic load solution here as it results in creation of multiple tables and synthetic keys .
Thanks