Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a green table below.
I want to get out like a red table, but I couldn't. I think I have to solve this on the script side.
Could you help?
Thanks.
This is a very unusual request, but yes, you can do that. Following an example:
TempSourceData:
LOAD
FormNo,
Onwer,
Responsible,
Date
INLINE [
FormNo, Onwer, Responsible, Date
1, Owner1, Resp1, 6/24/2024
1, Owner1, Resp2, 6/25/2024
1, Owner1, Resp3, 6/26/2024
2, Owner2, Resp1, 6/12/2024
2, Owner2, Resp5, 6/13/2024
];
NoConcatenate
TempIndexes:
LOAD
FormNo,
Onwer,
Responsible,
Date,
If(Not Match(FormNo, Peek(FormNo)),10102,Peek(Index)+1) AS Index
RESIDENT
TempSourceData
ORDER BY
FormNo,
Date
;
DROP TABLE TempSourceData;
Final:
LOAD
FormNo,
Onwer & ' ' & CONCAT(Chr(Index) & ' ' & Responsible,'',Date) AS Responsible_ALL
RESIDENT
TempIndexes
GROUP BY
FormNo,
Onwer
;
DROP TABLE TempIndexes;
This is the output of my example:
Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com
I would do that on Load Script.
To get the Responsible_ALL field you can use CONCAT:
Concat - script function | QlikView Help
It will be something lik this:
Owner & ' > ' & Concat(Responsible,' > ',CompletedDate) AS Responsible_ALL
All the other fields you can get with the appropriate Max Aggregations.
Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com
Thanks.
How can I use it instead?
' > '
chr(10102) .......
This is a very unusual request, but yes, you can do that. Following an example:
TempSourceData:
LOAD
FormNo,
Onwer,
Responsible,
Date
INLINE [
FormNo, Onwer, Responsible, Date
1, Owner1, Resp1, 6/24/2024
1, Owner1, Resp2, 6/25/2024
1, Owner1, Resp3, 6/26/2024
2, Owner2, Resp1, 6/12/2024
2, Owner2, Resp5, 6/13/2024
];
NoConcatenate
TempIndexes:
LOAD
FormNo,
Onwer,
Responsible,
Date,
If(Not Match(FormNo, Peek(FormNo)),10102,Peek(Index)+1) AS Index
RESIDENT
TempSourceData
ORDER BY
FormNo,
Date
;
DROP TABLE TempSourceData;
Final:
LOAD
FormNo,
Onwer & ' ' & CONCAT(Chr(Index) & ' ' & Responsible,'',Date) AS Responsible_ALL
RESIDENT
TempIndexes
GROUP BY
FormNo,
Onwer
;
DROP TABLE TempIndexes;
This is the output of my example:
Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com