Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Let's say I have two columns, C1 and C2. Both columns are numeric types.
Now I want to create a new column (say C3) in such a way that when the values are coming from C1, the list should contain the column name C1 and when the values are coming from C2, the list should contain the column name C2.
Any help will be really appreciated. Thanks in advance!
For example: See the below Inline data.
Data:
LOAD * INLINE [
C1, C2
764, 9062
4361, 74
36512, 908573
, 49659
35622,
,
];
and the final result should be like this:
C1 | C2 | C3 |
49659 | C2 | |
764 | 9062 | C1, C2 |
4361 | 74 | C1, C2 |
35622 | C1 | |
36512 | 908573 | C1, C2 |
table1:
LOAD C1,
C2,
If(Len(Trim(C1)),'C1')&If(Len(Trim(C1)) and Len(Trim(C2)),',')&If(Len(Trim(C2)),'C2') as C3
FROM [https://community.qlik.com/t5/QlikView-App-Dev/Make-a-list-using-two-column-names-in-QlikView/m-p/1856935] (html, codepage is 1252, embedded labels, table is @1);
hope this helps
Marco
LOAD C1, C2, Alt(C1,C2) as C3 FROM ...source...
Thanks for your response. But this is not what I am looking for. I want the column names instead of values. I have tried to explain in a better way in my edited questions. Please response back if you think of a solution for it.
table1:
LOAD C1,
C2,
If(Len(Trim(C1)),'C1')&If(Len(Trim(C1)) and Len(Trim(C2)),',')&If(Len(Trim(C2)),'C2') as C3
FROM [https://community.qlik.com/t5/QlikView-App-Dev/Make-a-list-using-two-column-names-in-QlikView/m-p/1856935] (html, codepage is 1252, embedded labels, table is @1);
hope this helps
Marco