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: 
Anonymous
Not applicable

conditional shows with set analysis and variables

Hello,

I'm having an issue using set analysis in a list box to show selections based upon a variable.

What's happening is I have 3 buttons for Volumes, Cost, and Profits.  These buttons control 2 variables (vCostList, vProfitList) and I'm using these variables to show which selections are possible (The selections make columns show in a table)

Everything works correctly except for when vProfitList is 1 and vCostList is 0.  When this happens the %MeasureGroup Volumes will show, but Profit will not.

I have pasted my code below.  Any help is greatly appreciated.

=if(vProfitList = 1 and vCostList = 1,
AGGR(
ONLY({1}
if(len(trim(%MeasureGroup))>1, %MeasureGroup & '\','') & %Measure
)
,%Measure
),
if(vProfitList = 1 and vCostList = 0,
AGGR(
ONLY({1}{$<%MeasureGroup = {'Volumes','Profit'}>}
if(len(trim(%MeasureGroup))>1, %MeasureGroup & '\','') & %Measure
)
,%Measure
),
if(vProfitList = 0 and vCostList = 1,
AGGR(
ONLY({1}{<%MeasureGroup = {'Volumes','Cost'}>}
if(len(trim(%MeasureGroup))>1, %MeasureGroup & '\','') & %Measure
)
,%Measure
))))
1 Reply
sasiparupudi1
Master III
Master III

Try putting the following in a text box and see if it returns any value

if(vProfitList = 1 and vCostList = 0,   

            AGGR(

        ONLY({1}{$<%MeasureGroup = {'Profit'}>}   

            if(len(trim(%MeasureGroup))>1, %MeasureGroup & '\','') & %Measure

        )   

        ,%Measure

hth

Sasi