Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik guys,
This is probably a very straight forward query but I can't figure it out!
I have 24 fields called RES_1 through to RES_24 (data within could by Y, N or blank but I want them included regardless of what the entry is) and I want to group them into a new field called GROUP consisting of Group 1, Group 2, Group 3 etc:
RES_1, RES_2, RES_9, RES_17, RES_21 would form "Group 1"
RES_3, RES_8, RES_15, RES_16 would form "Group 2"
RES_4, RES_5, RES_6, RES_7 would form "Group 3"
RES_10, RES_11, RES_14, RES_19 would form "Group 4"
and the remainder would form "Group 5"
Thanks in advance
That's a little bit trickier, but still not too bad...
Groups:
Load YourKeyFields, If(Group_1 = 'Y','Group 1') as Groups
Resident YourTable;
CONCATENATE
Load YourKeyFields, If(Group_2 = 'Y','Group 2') as Groups
Resident YourTable;
etc.
What is the definition of a "group" in this context?
It's simply the naming convention for a drill down...
I want to be able to highlight which Groups are present against a record
e.g. Item A has RES_1 and RES_3 selected as Y
therefore Item A has entries against Groups 1 and 2
Should also have added that I want to be able to select Group 1 and see a list of which Items have any RES fields selected from that Group
If I understand that correctly, it looks like it's just a set of If() statements, e.g.
if(RES_1='Y" OR RES_2 = 'Y' or RES_9 = 'Y' or RES_17 = 'Y' or RES_21= 'Y','Y') as Group 1
I've just tried one Group first and get the error: Field '’Y’' not found
If(RES_1 =’Y’ or RES_2 =’Y’ or RES_9 =’Y’ or RES_17 =’Y’ or RES_21 =’Y’,'Y') as GROUP_1,
Looks like a quotes issue - it should be a standard straight single quote / apostrophe (as with the last 'Y' in the statement you pasted), AKA ASCII code 39. All of your other 'Y's seem to have curly quotes.
Just noticed that... I'd been formatting in Word to try various options... changed font now and it's copying across correctly 🤕
I've got that working now as a Filter Pane... thank you!
I guess the next question now is how to get those individual groups into one field?
That's a little bit trickier, but still not too bad...
Groups:
Load YourKeyFields, If(Group_1 = 'Y','Group 1') as Groups
Resident YourTable;
CONCATENATE
Load YourKeyFields, If(Group_2 = 'Y','Group 2') as Groups
Resident YourTable;
etc.
Thank you so much for your help!
Have now got everything working exactly as required 😀