Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic Date as Dimension

Hey guys!

I need to create a Pivot which has three months as a Dimension. These months are based on the "Year" and "Month" fields selections, such as it shows the selected months and the two previous months. Therefore, if the user selects "2015" and "September", for example, I want my chart to show "September", "August" and "July" as it's dimension (all of them related to 2015, of course).

My database has data related to every month of the past five years and, therefore, I can't use the "Month" field as my dimension. Any ideas on how can I do this?

P.S.: I NEED the months to be my dimension due to some database particularities. They cannot be my expressions.

Thanks a lot!

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You should create a YearMonth field in your data model, even if you don't use it for display.

MakeDate(Year, Month) as YearMonth

Then you can use that field in Set modifiers, in either Dimensions or Expressions, to limit you display to max(YearMonth)-2.

-Rob

MarcoWedel

please post sample data to demonstrate.

regards

Marco

Not applicable
Author

Thanks for the response Rob!

I came up with the YearMonth field, but I don't know how to set this dimension limit. I tried "Show only" largest 3 and first 3. But it only shows the YearMonth selected.

How do I do this?