Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have this set of data
Need to get it like this
To be done in the script
Any Help Apprreciated
SCRIPT
a:
LOAD
rowno() as id,
[Account Group1],
ACCTSEGVAL
FROM
[https://community.qlik.com/thread/177148]
(html, codepage is 1252, embedded labels, table is @1);
b:
load
*,
if(ACCTSEGVAL=Peek(ACCTSEGVAL)+1, peek(Group), alt(Peek(Group),0)+1) as Group
Resident a
order by id;
final:
Start,
if(End=Start, null(), End) as End;
Group,
min(ACCTSEGVAL) as Start,
max(ACCTSEGVAL) as End
Resident b
group by Group, [Account Group1];
DROP Table a, b;
RESULT