Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
amr_qlik
Contributor
Contributor

Issue with creating a static top 10 chart

I'm attempting to create a partially static top 10 bar chart.  If the Product Number filter is used, nothing changes with the bar chart.  But if any other filter(s) is used, the top 10 changes to reflect the selection(s).  The measure (summarized) behind the visualization is below:

.2*count({<[Product Number]>}distinct[Column 1])/Max({1} total Aggr(count(distinct {1} [Column 1]), [Category])) +

...repeat the above line 5 times with different columns being used for each.... +

if((count({1}distinct{$ <[Fiscal Year] = {$(=MAX([Fiscal Year]))}>}
[Product Number]) -count({1}distinct{$ <[Fiscal Year] = {$(=MIN(Fiscal Year]))}>}
[Product Number])) > 0, '0.08', '0')

If I temporarily remove the if statement at the end, everything works exactly as  I want it to as far as filtering as requested.  But something about the if statement isn't working.  I've tried adding {<[Product Number]>} instead of {1} on separate tests to try and solve the problem, but that didn't solve the issue either.   

I went ahead and broke the if statement out into its various components to see if i could see what is going on.  The two individual count statements both produce values that make sense and appear correct and the final output appears fine as well when a product number is filtered.  However, I also made a quick table for the if statement and when I'm NOT filtering by Product Number the table isn't showing 0 and 0.08 where it should.  I've found multiple examples where unfiltered a product number has an output of 0.08, but when filtered the output for that same product number is changed to 0 (as it should've been all along).  I so far have not been able to find an example of the opposite happening, though obviously that doesn't mean that it's not in the list somewhere.

Any idea what might be wrong?

Labels (3)
0 Replies