Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

jorditorras
Contributor

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
Honored Contributor

Re: Number of records Filter

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

Re: Number of records Filter

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

jorditorras
Contributor

Re: Number of records Filter

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

Re: Number of records Filter

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

Community Browser