Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
zototo
Contributor III
Contributor III

Limitation to get Top values in Table isn't working properly

Hello everyone, 

I cannot understand how limitation in my table is working and hope you'll help me to figure out what am I doing wrong. 

There's a table with calculated measures in 20 columns and I need to limit Top-25 shops by Profit and show Others all together. My measure is in the middle of the table. On a sorting pane the needed measure is the first one. But when I do limitation with top 25 as fixed number it sorts it in absolutely non logical way. I have also played with the other measures but result was still the same. 

I read lot of topics in here and other places and this is what I tried:

1. There was assumption that maybe the problem is that data is coming from Oracle, so I tried to create null values so it was simply excluded with unselect null values. Didn't help, result is the same. And tried ='' and =0 in following:

if(if(SUM({ $< START_TS.autoCalendar.Date={"$(=Date(Max(START_TS.autoCalendar.Date)))"} > } COUNT_GAMES)>0,
SUM({ $< START_TS.autoCalendar.Date={"$(=Date(Max(START_TS.autoCalendar.Date)))"} > } COUNT_TERMINALS) ,0)=0,null(),
if(SUM({ $< START_TS.autoCalendar.Date={"$(=Date(Max(START_TS.autoCalendar.Date)))"} > } COUNT_GAMES)>0,
SUM({ $< START_TS.autoCalendar.Date={"$(=Date(Max(START_TS.autoCalendar.Date)))"} > } COUNT_TERMINALS) ,0))

2. I created a rank column to check how limitation works and with rank it hides the first row and puts it to Others, still sorting position is right. And also I don't need column with rank but have no idea how to use it within measure expression. 

rank(Sum( { $< START_TS.autoCalendar.Date={"$(=Date(Max(START_TS.autoCalendar.Date)))"} > } [SUM_BETS]-[SUM_WINS] )
-Sum( { $<START_TS.autoCalendar.Date={"$(=Date(Max(START_TS.autoCalendar.Date)))"} > } SUM_JACKPOTWIN ))

3. As far as I can see, the position of columns in table is playing some role because if I change it - list of limited shops is changing as well. But still - no idea how. Still - on sorting pane is the same Profit measure. 

4. Created table from the scratch twice just in case, used aggr - same. 

How can I have Top-25 shops and Others by Profit?

Thank you in advance!

Labels (6)
0 Replies