Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

TOP VALUE

Hi Community,

I use the left function to extract the first 4 characters of a string. The function works correctly but displays all records (with data and no data). Is there a TOP function in order to display only the first "n" values?


In the image below is the DTINRA filter box

8 Replies
Highlighted
Creator II
Creator II

Hi Fabio,

¿Can you attach sample data? ¿Which is the new field generated with the left sentence?

Grazie,

Josefina

Highlighted
Partner
Partner

Hi,

my box filter  use a dimension "year".

2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009

Data are the last 10 years.

I need a top function (similar to sql) showing only the last 3 years (2018,2017,2016)

Highlighted
Specialist III
Specialist III

Maybe this will be helpful:

Only({<Year={"=$(=rank(Year)<=3)"}>}Year)

This will show only three last years as you want to.

Cheers

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
Highlighted
Partner
Partner

so basically, you have a filter : year : containing 10 years or so;

and u want to have a new filter, that shows only the last 3 years? is that so?

if that the case:

create a master dimension:

Capture.PNG

The dimension would be :

=aggr(if(Year> max({1}total Year)-3,Year,Null()),Year)

result:

Capture.PNG

Highlighted
Specialist III
Specialist III

Fabio,

If any response above was helpful, please, close this thread by marking the correct response and those responses wich were helpful.

Cheers

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
Highlighted
Partner
Partner

u know, sometimes I try so hard to help, I would test and retest... for hours till I find the right solution and would be very excited and happy I could help.

I would expect some kind of recognizition for the time and effort I've put (even on holidays or weekends); but 50% of the ones who ask questions, once their problem is solved, won't even bother to thank us..

ps: my msg is not adressed to Fabio; It's a general thought I wanted to share.

Highlighted
Partner
Partner

Dear Fabio,

Please take a minute to review the responses, and mark any Helpful or Correct answers.

You can mark upto two helpful answers and one correct answer. This rewards other members for taking the time to assist you and also closing this thread will help others facing the similar issue.

Highlighted
Specialist
Specialist

Rank(yourField, n)