Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
jsingh71
Partner - Specialist
Partner - Specialist

how to get first nth date in pivot table?

HI ALL,

How I'll get the first nth date in Pivot table.

For example I have below sample date:

Date                    Sales

01-01-2014          100

02-01-2014          101

03-01-2014          100  

04-01-2014          100 

---------------          ------    and so on.

Now I want to display only first 3 date and their respective sales in pivot table.

Please help on this.

Thanks in advance

1 Solution

Accepted Solutions
Nicole-Smith

You can use the following as a calculated dimension (also see attached example.qvw):

=aggr(if(rank(Date)-count(total distinct Date)>-3,Date),Date)

View solution in original post

7 Replies
Not applicable

I would say that you need to use a Set Analysis:

sum ({<Date = {"< xxxx"}> } Sales)

or if the date is related to a key

sum({<Date_Key ={" <= 3 "}> } Sales)

Fabrice

Not applicable

Hi

or use calculated dimension to fix the set of dates you want

Chris

Nicole-Smith

You can use the following as a calculated dimension (also see attached example.qvw):

=aggr(if(rank(Date)-count(total distinct Date)>-3,Date),Date)

Not applicable

Excellent

Forgot that possibility !!

Fabrice

jsingh71
Partner - Specialist
Partner - Specialist
Author

Hi Fabrice and Chris

Thanks for reply... I tried calculated dimension also but  how I apply Rank function in date dimension.

Nicole-Smith

Right like in my post above...

jsingh71
Partner - Specialist
Partner - Specialist
Author

thanks Nicole......its working fine...