Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the last three values in the date column

hi experts,

can any one help me on this.

I have table with filed names Date,Sales and country,i want to display last 3 dates as one bucket and 5 date values as one bucket,that two buckets will work like a fields.

   

DateSalesCountry
1-Apr-154566.24Germany
2-Apr-154122.30Germany
3-Apr-154185.72Germany
4-Apr-155073.60Germany
5-Apr-15951.30Germany
6-Apr-154566.24Germany
7-Apr-154724.79Germany
8-Apr-153963.75Germany
9-Apr-154230.11Germany
10-Apr-154299.88Germany
11-Apr-155073.60Germany
12-Apr-15317.10Germany
13-Apr-153963.75Germany
14-Apr-153963.75Germany
15-Apr-154724.79Germany
16-Apr-153963.75Germany
17-Apr-154230.11Germany
18-Apr-151458.66Germany
19-Apr-151204.98Germany
20-Apr-154724.79Germany
21-Apr-153963.75Germany
22-Apr-154230.11Germany
23-Apr-154724.79Germany
24-Apr-153963.75Germany
25-Apr-151426.95Germany
26-Apr-15780.07Germany
27-Apr-154724.79Germany
1-Apr-155288.40UK
2-Apr-154774.25UK
3-Apr-154847.70UK
4-Apr-155876.00UK
5-Apr-151101.75UK
6-Apr-155288.40UK
7-Apr-155472.03UK
8-Apr-154590.63UK
9-Apr-154899.12UK
10-Apr-154979.91UK
11-Apr-155876.00UK
12-Apr-15367.25UK
13-Apr-154590.63UK
14-Apr-154590.63UK
15-Apr-155472.03UK
16-Apr-154590.63UK
17-Apr-154899.12UK
18-Apr-151689.35UK
19-Apr-151395.55UK
20-Apr-155472.03UK
21-Apr-154590.63UK
22-Apr-154899.12UK
23-Apr-155472.03UK
24-Apr-154590.63UK
25-Apr-151652.63UK
26-Apr-15903.44UK
27-Apr-155472.03

UK

i

1 Solution

Accepted Solutions
MayilVahanan

HI

Are you looking like Attachment?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

7 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Can you post a screenshot of the output you want, based on the data set you posted (for example an Excel example)?

Anonymous
Not applicable
Author

may be like this:

Use as a Calculated Dimension:

=only({<Date=, Date={'>=$(=Date(max(Date)-3),'DateFormat')<=$(=date(max(Date)),'DataFormat')'}>} Date)

make sure format should be same of your Date Field and Expression in Set analysis

And then your expression like:

=sum(Sales)

Anonymous
Not applicable
Author

This will give you last 3 days, same way you can go for 5 days

MayilVahanan

HI

Are you looking like Attachment?

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

hi Balarj,

thanks for your answer,but it's not getting desired result.

Anonymous
Not applicable
Author

Post a sample data or qvw

Not applicable
Author

Thank you vary much ramasamy.

regards

siva