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

New to Qliksense - Dynamic date in Set Analysis

I have set up 12 date period dimensions using the below calculation: (Month_ is my date field which is Month/Year)

addmonths(date#(Month_,'MMMM YYYY'),-0)  - This is for current month ([Period 1])

addmonths(date#(Month_,'MMMM YYYY'),-1)  - This is for previous Month ([Period 2])

addmonths(date#(Month_,'MMMM YYYY'),-2)  -  ([Period 3]) etc....

Now I want to SUM [Net Revenue] by each date dimension so I will have 12 [Net Revenue] calculations which will be dependent on what is selected on the [Month_] filter.

My calculation for this is:   Sum({<Month_={'$=[Period 1]'}>}[Net Revenue])

This is not working.  Output for this is 0 however if I add 'January 2019' instead of [Period 1] it works fine 

Sum({<Month_={'January 2019'}>}[Net Revenue].

Any help with this would be appreciated. 

Thank you.

 

 

Labels (2)
1 Solution

Accepted Solutions
pradosh_thakur
Master II
Master II

What's the out put of below

addmonths(date#(Month_,'MMMM YYYY'),-0)
addmonths(date#(Month_,'MMMM YYYY'),-1)

Sum({<Month_={"$(=addmonths(date#(Month_,'MMMM YYYY'),-0))"}>}[Net Revenue])
Learning never stops.

View solution in original post

3 Replies
pradosh_thakur
Master II
Master II

What's the out put of below

addmonths(date#(Month_,'MMMM YYYY'),-0)
addmonths(date#(Month_,'MMMM YYYY'),-1)

Sum({<Month_={"$(=addmonths(date#(Month_,'MMMM YYYY'),-0))"}>}[Net Revenue])
Learning never stops.
fosuzuki
Partner - Specialist III
Partner - Specialist III

Try using your expression like this:
Sum({<Month_={'$([Period 1])'}>}[Net Revenue])
JamesC
Contributor
Contributor
Author

Sum({<Month_={"$(=addmonths(date#(Month_,'MMMM YYYY'),-0))"}>}[Net Revenue])

Worked perfectly.

Thank you so much 🙂