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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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