Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In script I need some help to combine cells. Column REASON includes the values to be grouped into one cell by column "KEY". Below example.
Is there any way to do it?
Main column:
Key | REASON |
ABC1 | R01 |
ABC1 | R02 |
ABC1 | R03 |
ABC1 | R04 |
ABC2 | R02 |
ABC2 | R03 |
ABC2 | R04 |
ABC2 | R05 |
ABC2 | R06 |
ABC2 | R07 |
ABC2 | R08 |
To be:
Key | REASON_ALL |
ABC1 | R01|R02|R03|R04 |
ABC2 | R02|R03|R04|R05|R06|R07|R08 |
load
Key,Concat(Reason,'|') as Reason
from table group by Key;
The Concat() function does exactly this. It can be used either in the script or in the QlikView UI.
Concat(distinct REASON, '|')
HIC
LOAD Key, Concat(REASON,'|') as reasonAll
Resident Test
Group By Key;