Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a Qlik Sense table where the dimension is limited using:
Dimension → Limitation → Show first N rows
The table correctly displays only those N rows.
However, the Totals row still calculates using all rows, not just the limited/displayed rows.
My requirement is:
Show only first N rows in the table
Totals row should reflect only those same N rows
Total mode must remain = Auto because the measure contains complex calculations
Example:
| Partner | Sales |
|---|---|
| A | 500 |
| B | 400 |
| C | 300 |
| D | 200 |
| E | 100 |
If I limit the dimension to Top 3 rows, the table shows:
A, B, C
But the Totals row still calculates using all rows (A+B+C+D+E) instead of A+B+C.
Is there a way to make Auto totals respect the dimension limitation, or is this expected Qlik behavior?
I would like to avoid switching Total mode to Sum, since the measure relies on Auto total logic.
Hey,
I’m not sure if this is Qlik’s expected behavior, but I tried your approach and the totals do ignore the limitations. If you’re interested in showing the top/bottom N rows, you might be able to fix it using a rank function as follows:
Sum({<[field] = {"=Rank(Sum([value])) <= 3"}>} [value])
Default sort order of the field:
Sum(Aggr(IF(RowNo() <= 3, [value]), [field]))
I’m not sure how complex your table is, but you should be careful when using RowNo() if there are multiple columns in the table. You might need to use RowNo(TOTAL) instead.
Hope this works for you.
Regards,