Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated dimension for max date of each month

dates.png

I'm trying to get a calculated dimension so that only one date for each month is shown in the dimension, how do I do this?

Based on the example above, I want my dimension values to be:

1/04/2014

12/31/2013

11/11/2013

9/30/2013

Any help would be greatly appreciated!

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

You can achieve this by two ways...

Create one more field in your script...

Month(DateField) as Month

1) Using Calculated Dimension

Aggr(Max(DateField),Month)

Expression

SUM(Sales) //or whatever as per your data model

2) Using Set Analysis

Dimension

Date

TIck Suppress When Value is NULL

Expression

Aggr(SUM({<Date = {"=Aggr(Max(Date),Month)"}>}Sales),Month)

Performance of 2nd method is much better for Large DataBase...

View solution in original post

3 Replies
tresesco
MVP
MVP

Assuming that you have a Month field as well, you can try expression like: =Aggr(Max(Date), Month)

MK_QSL
MVP
MVP

You can achieve this by two ways...

Create one more field in your script...

Month(DateField) as Month

1) Using Calculated Dimension

Aggr(Max(DateField),Month)

Expression

SUM(Sales) //or whatever as per your data model

2) Using Set Analysis

Dimension

Date

TIck Suppress When Value is NULL

Expression

Aggr(SUM({<Date = {"=Aggr(Max(Date),Month)"}>}Sales),Month)

Performance of 2nd method is much better for Large DataBase...

Not applicable
Author

Thank you, Manish!

Your 2nd method using set analysis is exactly what I was trying to figure out. It does not sum all the values for each month, but rather just displays a single value that corresponds to the single date that is displayed, which is what I wanted.