Discussion board where members can get started with Qlik Sense.
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, GroupApple,1Coconut,1Dragonfruit,1Elephant,2Fox,2Gold,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?
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.
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