Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

check to see if a value equals selected filters

I have loaded a table into my script with the columns 'Condition' and 'Target'. How can I check to see if my 'Condition' value equals filters selected?

For example:

Filters are SubRegion, Quarter, and GBU. So if I have 'Brazil' selected for SubRegion, 'Q2' selected for Quarter, and 'ABS' selected for GBU, how do I match it to my Condition value that is 'BrazilQ2ABS'?

I have tried the following:

if(Condition = concat(getfieldselection(SubRegion),getfieldselection(Quarter),getfieldselection(GBU)),Target,0)

but it doesn't appear to be matching. Help please!

11 Replies
JonnyPoole
Former Employee
Former Employee

To maintain conditions as a data island, a 'select in field' action should work.  I don't know why it would have stopped working.   Did you refresh the document with new data ?  if you put '=only(SubRegion)&only(Quarters)&only(GBU)' in a text box does it still return a legitimate value ?

Not applicable
Author

yes it works perfectly in a text box. I did refresh the document with new data but the table format and column headers stayed the same. I was able to create a workaround using fieldvalue and field index. I put my expression in a variable and it works great. But I now have a new issue - how do I use my variable in an expression that only recognizes filters from those three fields (SubRegion, Quarter, GBU) or no filters at all? When I use sum with exclusions the variable returns the wrong value (ex sum({<field1=, field2=, etc.>} vTarget)

I have posted the new question here with more details: http://community.qlik.com/thread/138155

but perhaps you can help me?