Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ruma_barman
Creator
Creator

If statement using getfieldselections function is not working properly

Hi All,

I want to get an expression according to the sequence of values selected from a dimension using the following expression if(match(subfield(GetFieldSelections(KPIs),',',1),null()),sum(0),sum(Sales)). If statement is not working properly.

Is anything wrong here?

Thanks,

Ruma

1 Solution

Accepted Solutions
jaumecf23
Creator III
Creator III

Hi,

Try this:

if(isnull(subfield(GetFieldSelections(KPIs),',',1)),sum(0),sum(Sales))

View solution in original post

8 Replies
jaumecf23
Creator III
Creator III

Hi,

Try this:

if(isnull(subfield(GetFieldSelections(KPIs),',',1)),sum(0),sum(Sales))

ruma_barman
Creator
Creator
Author

Hi Jaume,

Thanks for your response. Can you kindly check the pick match statement in the attached app.

It is working for subfield 1 and not for subfield 2.

Thanks in advance,

Ruma

jaumecf23
Creator III
Creator III

Try this:

if(isnull(subfield(GetFieldSelections(KPIs),',',2)),'KPI not selected','KPI selected')

ruma_barman
Creator
Creator
Author

Not this one.In the new qvf..there is one pick match statement.community.png

jaumecf23
Creator III
Creator III

Maybe this is what you need:

pick(mixmatch(subfield(GetFieldSelections(KPIs),',',1),'A','B','C'),'Aa','Bb','Cc')

pick(mixmatch(subfield(GetFieldSelections(KPIs),',',2),'A','B','C'),'Aa','Bb','Cc')

ruma_barman
Creator
Creator
Author

Hi Jaume,

First pick statement is working but not the second one.Can you share the qvf ?

jaumecf23
Creator III
Creator III

You're right, there was an issue. Try this:

pick(mixmatch(trim(subfield(GetFieldSelections(KPIs),',',1)),'A','B','C'),'Aa','Bb','Cc')

pick(mixmatch(trim(subfield(GetFieldSelections(KPIs),',',2)),'A','B','C'),'Aa','Bb','Cc')

ruma_barman
Creator
Creator
Author

It's working.Thanks a lot.