Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Advanced crosstable

Hello,

I have an excel file in such format:

PROFILEREDUCTIONFIELDREDUCTIONVALUE
P02%REPORTINGUNITCODEDE001_LC01
P02%REPORTINGUNITCODEDE001_LC02
P03%REPORTINGUNITCODEDE001_IC01
P04%REPORTINGUNITCODEDE001_LC01
P04%REPORTINGUNITCODEDE001_LC02
P05%REPORTINGUNITCODEDE001_LC01
P05%REPORTINGUNITCODEDE001_LC02
P09%REPORTINGUNITCODEDE001_LC01
P04%CUSTOMERDISTRIBUTIONCHANNEL1CODE001
P05%CUSTOMERDISTRIBUTIONCHANNEL1CODE004
P09%CUSTOMERDISTRIBUTIONCHANNEL1CODE003
P09%CUSTOMERDISTRIBUTIONCHANNEL1CODE004

From this, I would need to create 2 tables:

%REPORTINGUNITCODE:

PROFILE%REPORTINGUNITCODE
P02DE001_LC01
P02DE001_LC02
P03DE001_IC01
P04DE001_LC01
P04DE001_LC02
P05DE001_LC01
P05DE001_LC02
P09DE001_LC01

and %CUSTOMERDISTRIBUTIONCHANNEL1CODE

PROFILE%CUSTOMERDISTRIBUTIONCHANNEL1CODE
P04001
P05004
P09003
P09004

It must be a generic routine, so when extra REDUCTIONFIELD are added to the 1st table; extra table would be automatically generated.

I guess, there is a matter of sorting the records at the first place, and identify when the current records is having a new REDUCTIONFIELD.

How would you write such routine in QV script?

Thanks in advance

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hei

attach is an example of what you asked for

hope its helps you

View solution in original post

2 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

attach is an example of what you asked for

hope its helps you

Not applicable
Author

Exactly what I was looking for! Thanks!