Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikArno
Contributor
Contributor

How to filter the display but not the calculations?

Hi Qlik Community,

For my dashboard I would like to display the five most recent rows of a larger data set. However, the content of other fields in this table is depending on previous rows that changes when I filter on date. The rows that are filtered are hereby not taken into account in the calcutations anymore. For example, when I filter the five most recent rows in the table:

 

Date

Measure

1 January

1

2 January

2

3 January

3

4 January

4

5 January

5

6 January

6

7 January

7

8 January

8

9 January

9

10 January

10

11 January

11

12 January

12

13 January

13

 

I get:

Date

Measure

9 January

1

10 January

2

11 January

3

12 January

4

13 January

5

 

whereas the desired outcome is:

Date

Measure

9 January

9

10 January

10

11 January

11

12 January

12

13 January

13

 

What do I need to do to get the third table?

Thank you in advance for your suggestions,

Arno van Akkeren

Labels (1)
6 Replies
QlikArno
Contributor
Contributor
Author

Any thoughts about this issue? Your suggestions will be appreciated!

anushree1
Specialist II
Specialist II

how is the measure column calculated for the given data?

Kushal_Chawda

do you want latest records from script itself? what is the unique key in your data?

QlikArno
Contributor
Contributor
Author

Thank you for your reply. I have this issue with several columns. For example:

If( Sum(Measure) > Above(Sum(Measure),1)
AND Above(Sum(Measure),1) > Above(Sum(Measure),2)
AND Above(Sum(Measure),2) > Above(Sum(Measure),3)
AND Above(Sum(Measure),3) > Above(Sum(Measure),4)
AND Above(Sum(Measure),4) > Above(Sum(Measure),5)
AND Above(Sum(Measure),5) > Above(Sum(Measure),6)
, '1'
, '0')

In this example a data set of at least seven days is required. I want to display the last five days. However, I want the days in prior to the five day period to be part of the calculation. Using the logic above in the column Calculation:

DateMeasureCalculation
1 January10
2 January20
3 January30
4 January40
5 January50
6 January60
7 January71
8 January81
9 January91
10 January101
11 January111
12 January121
13 January131

 

The desired result is:

DateCalculation
9 January1
10 January1
11 January1
12 January1
13 January1

 

The result I get:

DateCalculation
9 January0
10 January0
11 January0
12 January0
13 January0
QlikArno
Contributor
Contributor
Author

Thank you for your reply.

I'm not sure what you mean with 'from script itself'. I want to display the last five rows in the table that I get when I run the code.

The unique key consists of the fields MeasureName and Date. I didn't mention the column MeasureName in the example because I didn't think it was relevant.

Kushal_Chawda

Create table with Dimension Date  below expression

= if(ceil(((Count(total Date)-5)+1)/RowNo(total))=1,1,0)

Note:

If you want to show last 7 change the number highlighted in red to 7. Also make sure that the Date is sorted in ascending order. Go to chart properties->Add-on-> Uncheck 'Include suppress zero' value