Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

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
Highlighted

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
Highlighted
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

Highlighted
Not applicable

Hi

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

Chris

Highlighted

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

Highlighted
Not applicable

Excellent

Forgot that possibility !!

Fabrice

Highlighted
Partner
Partner

Hi Fabrice and Chris

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

Highlighted

Right like in my post above...

Highlighted
Partner
Partner

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