Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Now Live: Qlik Sense SaaS Simplified Authoring – Analytics Creation for Everyone: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Group

Hi All,

I am trying to create a group in the script , and this gets executed in the output i don't see  GR1 and GR2 . 

how do i get this ? 

if(WildMatch(goup,'host'),'host',
if(WildMatch(goup,'payments'),'payments',
if(WildMatch(goup,'roles'),'roles',
if(WildMatch(goup,'hr'),'hr',
if(WildMatch(goup,'dudes'),'dudes',
if(WildMatch(goup,'check'),'check',
if(WildMatch(goup,'pass'),'pass',
if(WildMatch(goup,'pass','dudes','check'),'GR1',
if(WildMatch(goup,'pass','host','hr'),'GR2'
)))))))))as Create_Group

 

 

Thanks in Advance 

6 Replies
ariel_klien
Specialist
Specialist

Hi, Because the if ended before he get to GR1\2 You can make another field for GR1 and another to GR2 OR you can load the same code for only GR1 and only GR2 and concatenate the 3 tables. Ariel.
smilingjohn
Specialist
Specialist
Author

Is there no way to achieve this within one group? 

martinpohl
Partner - Master
Partner - Master

hi,

how should it work to set the datas into one group.

Either if statement one is right, so you get result one or the if-statement for GR is right so you get result two.

An if-statement quits if the first result is true.

Regards

ariel_klien
Specialist
Specialist

Hi,

you can do something like this:

MainTable:
load * From ...;

Groups:
Load  goup,
      if(WildMatch(goup,'host'),'host',
      if(WildMatch(goup,'payments'),'payments',
      if(WildMatch(goup,'roles'),'roles',
      if(WildMatch(goup,'hr'),'hr',
      if(WildMatch(goup,'dudes'),'dudes',
      if(WildMatch(goup,'check'),'check',
      if(WildMatch(goup,'pass'),'pass'))))))) as Create_Group
resident Main Table;

Concatenate (Groups)
load goup,
'GR1' as Create_Group
resident MainTable
where WildMatch(goup,'pass','dudes','check');

Concatenate (Groups)
load distinct goup,
'GR2' as Create_Group
resident MainTable
Where WildMatch(goup,'pass','host','hr')

Brett_Bleess
Employee
Employee

Did Ariel's last post work for you?  If so, be sure to use the Accept as Solution button on that post to give him credit for the help and let others know that worked.  If you did something different, consider posting that and mark that as the solution and if you are still working on things, leave an update for us.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
rwunderlich

Your GR1 condition is true if goup = 'pass' OR 'dudes'.  However, that condition would have been met in the earlier if() and therefore the GR1 if() is not executed. 

If you are trying to create a one-to-many relationship where one goup links to many Create_Group, you should load a separate table like this:

Groups:
LOAD * INLINE [
goup, Create_Group
host, host
payments, payments
dudes, dudes
pass, pass
pass, GR1
dudes, GR1
etc
];

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com