Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am new to Qlik Sense & I am trying to implement a logic into qlik editor but I am stuck at a point. How can I add multiple rows based on the calculation of values of 2 columns?
I have a following table:
Table_A:
ID | Items | From | Till | Check |
501 | 8 | 111 | 120 | 2 |
502 | 10 | 781 | 792 | 2 |
I want to create a new column which adds the rows value between 'till' and 'from' columns.
e.g. (120+1) - 111 = 10,
10 values = 111,112,113,...,119,120
Output_Table:
ID | Value |
501 | 111 |
501 | 112 |
501 | 113 |
501 | 114 |
501 | 115 |
501 | 116 |
501 | 117 |
501 | 118 |
501 | 119 |
501 | 120 |
502 | 781 |
502 | 782 |
502 | 783 |
502 | ... |
502 | 792 |
Temp_Table:
LOAD * inline [
ID, Items, From, Till, Check
501, 8, 111, 120, 2
502, 10, 781, 792, 2
];
Table:
LOAD *,
From + IterNo() - 1 as Value
Resident Temp_Table
While Till >= From + IterNo() - 1;
Drop Table Temp_Table;
Temp_Table:
LOAD * inline [
ID, Items, From, Till, Check
501, 8, 111, 120, 2
502, 10, 781, 792, 2
];
Table:
LOAD *,
From + IterNo() - 1 as Value
Resident Temp_Table
While Till >= From + IterNo() - 1;
Drop Table Temp_Table;