Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Facundo
Contributor II
Contributor II

Chart with Dimension of "Today", "current month" and "current month of last year"

Hi!,


I need to create a chart to display :


Expressions :

SUM(Quantity)

SUM(Sales)


One Dimension:

"Today", "Current Month" and "Current Month of Last Year".


I have a Date column.


Example :


1.png

How can i achieve this?

Thanks!

10 Replies
sunny_talwar

You can use ValueList() function to create a synthetic dimension and then use Pick(Match()) to assign values using set analysis to the three different dimension or you can use an Island Table approach and again use Pick(Match()) to assign value to each of the three components of your dimension

Facundo
Contributor II
Contributor II
Author

Thanks for the quick answer, can you give me an example? because I tried but failed.

sunny_talwar

Check this out

Capture.PNG

vinieme12
Champion III
Champion III

Add a flag for today in the below and your set expression will be a lot more simpler

Period Presets: Compare Periods on the fly

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Facundo
Contributor II
Contributor II
Author

Thanks!, I think this is the way to go, but can't make it work if I replace "Today" for max selected date on the calculated dimension, I recieve an "Error on calculated dimdension".

I replaced this :

=Pick(Dim,

Date(Today(), 'DD-MM-YYYY'),

Date(MonthStart(Today()), 'MMM-YY'),

Date(MonthStart(Today(), -1), 'MMM-YY'))

For this :

=Pick(Dim,

Date(MAX(Date), 'DD-MM-YYYY'),

Date(MonthStart(MAX(Date)), 'MMM-YY'),

Date(MonthStart(MAX(Date), -1), 'MMM-YY'))

sunny_talwar

Try this:

=Pick(Dim,

Date(MAX(TOTAL Date), 'DD-MM-YYYY'),

Date(MonthStart(MAX(Date)), 'MMM-YY'),

Date(MonthStart(MAX(Date), -1), 'MMM-YY'))

Facundo
Contributor II
Contributor II
Author

Thanks again!; it's working, but don't know why, when the first date of the month is selected, it doesn't work.

Check attached qvw.

sunny_talwar

The attached should work now. But I think there are simpler ways to do this kind of stuff. I will revisit this in the evening with a better solution

Facundo
Contributor II
Contributor II
Author

Thanks again Sunny, it's working on the example, but when I try to replicate on my application, doesn't work.

I will wait for your evening solution.