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: 
akuttler
Creator
Creator

Dimension with Set Modifier

Hello,

I want a dimension for Months only in 2018 (jan-aug), so I can compare y2y

I have an expression:

=Month({<ServiceYear = {'2018'}>} ServiceDate)

But it give me an error.

I am trying to create a line chart that compares payments per month by year, but only for the months available in current yer Jan- Aug

1 Solution

Accepted Solutions
bwisealiahmad
Partner - Specialist
Partner - Specialist

Hi,

Wouldn't it be easier to do this with SET Analysis?

Very simplified example:

Sum({<Year = {'2018'}>}Amount) for 2018

Sum({<Year = {'2017'}>}Amount) for 2017

and month as dimension?

What is your actual expression?

Best,

Ali A

View solution in original post

4 Replies
Quy_Nguyen
Specialist
Specialist

Hi,

Try this for the chart dimension:

=If(ServiceYear = 2018, Month(ServiceDate))

Uncheck Include null values

akuttler
Creator
Creator
Author

That filters out previous years....I want January- August, so I can stack lines representing previous years on top of each other. So 2016 Jan -Aug, 2017 Jan -Aug etc.

Quy_Nguyen
Specialist
Specialist

Try this for your line chart:

Dim1 for Month:

     =If(Num( Month(ServiceDate)) <= $(=Num(Month(Max(ServiceDate)))), Month(ServiceDate))

Dim2 for Year:

     =ServiceYear

Uncheck Include null values

bwisealiahmad
Partner - Specialist
Partner - Specialist

Hi,

Wouldn't it be easier to do this with SET Analysis?

Very simplified example:

Sum({<Year = {'2018'}>}Amount) for 2018

Sum({<Year = {'2017'}>}Amount) for 2017

and month as dimension?

What is your actual expression?

Best,

Ali A