Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
napac1458
Contributor II

match values within a variable

Hello,

I'm wondering how I can place multiple text values within a variable and, if a selected dimension value matches one of the values in the variable, activate a button.

The variable contains comma separated values and I'm trying to say that when a selected value in a dimension = a value in the variable, show 1, 0.

Something like this:

if(match(Getfieldselections(Dimension),Variable),1,0)

My variable is set like this in the script:

Set Variable = 'Text1','Text2','Text3';

Any suggestions?

1 Solution

Accepted Solutions

Re: match values within a variable

Or this if the button should be hidden when not selection in Dimension is made

Max(Aggr(If(SubStringCount(Variable, Dimension) >= 1, 1, 0), Dimension)) and GetSelectedCount(Dimension) > 0

9 Replies

Re: match values within a variable

Try this:

Max(Aggr(If(SubStringCount(Variable, Dimension) >= 1, 1, 0), Dimension))

Re: match values within a variable

Sample attached

Re: match values within a variable

Or this if the button should be hidden when not selection in Dimension is made

Max(Aggr(If(SubStringCount(Variable, Dimension) >= 1, 1, 0), Dimension)) and GetSelectedCount(Dimension) > 0

vishsaggi
Esteemed Contributor III

Re: match values within a variable

Sunny, why we need Max(Aggr()) cant we just use

like in layout conditional

= vVar = If(SubStringCount(Variable, Dimension) >= 1, 1, 0)     ??

Re: match values within a variable

If this need to work only based on a single selection, then without Max and Aggr() will work... but in case we need this to work based on multiple selection, then without Max and Aggr() it will not work....

vishsaggi
Esteemed Contributor III

Re: match values within a variable

Ah, Got it. Thanks for that.

napac1458
Contributor II

Re: match values within a variable

Thank you both for the responses!  I only needed it to be based on a single selection and it's working without the max and aggr.

vishsaggi
Esteemed Contributor III

Re: match values within a variable

David, by mistake you have made my response as correct. I did not give that solution, i got that from Sunny. I have just asked that question to him.

vishsaggi
Esteemed Contributor III

Re: match values within a variable

No harm, Even though you use them, it still works...So, i feel i should not be credited for this as i just copied from his expr.