Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jorditorras
Creator
Creator

Number of records Filter

Dear Gurus,

I have a table like:

Date_TimeKPI 1 KPI 2
22/11/2017 15:30:343447
22/11/2017 15:29:24345475
22/11/2017 15:28:453464
22/11/2017 15:27:256347
22/11/2017 15:26:17645
22/11/2017 15:25:53647
22/11/2017 15:24:455574

Each line is a record and I would like to have a filter in QlikSense Application to filter las "n" records (something like a "Last n counter"). Is there any way to generate this?

Thanks!

Regards,

Jordi

4 Replies
ali_hijazi
Partner - Master II
Partner - Master II

rank function would help

suppose your aggregate function is sum(KPI1) then your expression would be something like this:

first create a variable called vKPI1 with the definition above

then your final expression is:

sum({<Customer={"=Rank($(vKPI1))< $(topN)"}aggr($(vKPI1),Customer))

and topN is a variable you can put in it 3 or any integer

if this is doesn't help send me a sample qvw file so that I can further help

I can walk on water when it freezes
sunny_talwar

Last n based on the order they are loaded? also, do you need dashboard wide selection or in a particular chart?

jorditorras
Creator
Creator
Author

It would be last "n" Date_Times. Something like the "n" top values of Date_Time

I need to have the possibility to choose last 4 or 6 or 10 or etc... values.

I hope I'm explaining well...

Thanks,

Regards,

Jordi

sunny_talwar

May be like this

Sum({<Date_Time = {"$(='>=' & TimeStamp(Max(Date_Time, vVar), 'DD/MM/YYYY hh:mm:ss'))"}>}KPI1)

vVar is a variable which will decide how many top values you want to see.... 4, 6, 10 etc