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: 
mp802377
Creator II
Creator II

ValueList in Pie Chart

Hello,

I am getting a 'No data to display' with what I have below. I have three categories and I need to do a count, not a sum. I first started with Pick, but looking at discussions, I saw something like this.

Dimension

=(ValueList('We Win','Matched','They Win'))



Expression

=IF(ValueList('We Win','Matched','They Win') = 'We Win',

Count(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE))<0,

=IF(ValueList('We Win','Matched','They Win') = 'Matched',

Count(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE))=0,

=IF(ValueList('We Win','Matched','They Win') = 'They Win',

Count(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE))>0,

)))


Thank you,

Martha

21 Replies
sunny_talwar

Try this

=If(ValueList('We Win','Matched','They Win') = 'We Win',

Sum(Aggr(If(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE) < 0, 1, 0), OBJECT)),

If(ValueList('We Win','Matched','They Win') = 'Matched',

Sum(Aggr(If(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE) = 0, 1, 0), OBJECT)),

If(ValueList('We Win','Matched','They Win') = 'They Win',

Sum(Aggr(If(Min({$<SITE={$(=[Base Site)}>} FARE) - Min(FARE) > 0, 1, 0), OBJECT)),

)))

Removed three extra parenthesis from here

Capture.PNG

mp802377
Creator II
Creator II
Author

That didn't work, I got an error. But I did find the solution and wanted to post it here.

pick(

match(ValueList('We Win','Matched','They Win'),'We Win','Matched','They Win')

,Sum( total Aggr( If((Min(SITE={$(=[Base Site])}>} FARE) - Min(FARE)) < 0, 1, 0), OBJECT))

,Sum( total Aggr( If((Min(SITE={$(=[Base Site])}>} FARE) - Min(FARE)) = 0, 1, 0),OBJECT))

,Sum( total Aggr( If((Min(SITE={$(=[Base Site])}>} FARE) - Min(FARE)) > 0, 1, 0), OBJECT))

)

Thank you so much for your help. I wouldn't have the answer without your help.

Martha