Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlikers,
I trying to group certain value into different group.
Is there anyway to shorten or replace below scripting in order to avoid long typing time.
I suggest using the ApplyMap function:https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Scripting/Ma...
You can create a map like this, or load from file:
GroupMap:
Mapping Load * inline
[
Name, Group
Apple,1
Coconut,1
Dragonfruit,1
Elephant,2
Fox,2
Gold,2
];
Then use this line to get group:
ApplyMap('GroupMap',Name,'N/A') as Group
Hi @Quy_Nguyen ,
Thanks for your quick response.
This seem better than what i using at the moment.
Just another question - what if i have more than 20 line of that?
Hi,
As I said, you could use a file to manage it. For future changes, you just have to update the file instead of making any change in your script.
Hi,
maybe
SET vGroup1 = 'Apple','Banana','Coconut','Dragonfruit','Elephant';
SET vGroup2 = 'Fox','Gold';
If(Match(Name,$(vGroup1))>0,'1', If(Match(Name,$(vGroup2))>0,'2')) as Group