Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dia2021
Creator
Creator

Quarter Calculations

Hi All,

Could you please help me with the syntax? I'm trying to subtract the current max month Quarter Value from the Previous max month Quarter value.

I have created two variables. 

Let vCurrentQtr = 'Q' & ceil(month(today()) / 3)&'-' & Year(today());
Let vPreviousQtr = 'Q' & ceil(month(addMonths(today(),-3)) / 3)&'-' & Year(addMonths(today(),-3));

but while set analysis at the front end using this formula gives me an error 

sum({<Date={$(vCurrentQtr)}>}budhrs)-sum({<QuarterYear={$(vPreviousQtr)}>}budhrs)

Please see attached screenshot for an error. Can anyone help me fixing this syntax? Thanks in advance!

dia2021_0-1632186566946.png

 

 

Labels (1)
14 Replies
PrashantSangle

If possible share your app.

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
dia2021
Creator
Creator
Author

@Kushal_Chawda Thank you so much! It worked for me! 

dia2021
Creator
Creator
Author

 Another question on the same topic - It's providing the difference between the current and the previous quarter. 

What changes do I need to make if I need sum of BUDHRS FOR max month of the previous quarter?

Kushal_Chawda

@dia2021  try below for max month of previous quarter

sum({<Date={">=$(=monthstart(quarterend(today(1),-1)))<=$(=quarterend(today(1),-1))"}>}budhrs)

dia2021
Creator
Creator
Author

@Kushal_Chawda Thank you so much !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 

I'm getting numbers as expected 🙂