Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Marissa23
Contributor
Contributor

Current Month and Prior Month expression help

Hello, 

I am trying to write an expression that will return the prior month based on user filter selection.

So, the filter is Date field. The expression itself works, however when I try to add logic to retrieve prior month it returns 0.

Any help on what I am missing?

Thank you! 

Marissa

 

Sum({$<Date = {"$(=AddMonths( Date, -1))"}>} (earned_hours)/(((number_of_business_days) - (actual_fte_outofoffice)) * ((actual_fte_factor_per_month)) * 5))

 

 

Labels (1)
1 Reply
Vinay_B
Support
Support

Hi @Marissa23 

Can you try the below?

 

LET vPriorMonth = AddMonths( Date, -1);

Sum({$<Date = {"$(vPriorMonth)"}>} earned_hours / (((number_of_business_days) - (actual_fte_outofoffice)) * ((actual_fte_factor_per_month)) * 5))

I have used a variable to store the prior month's date and then use that variable in set analysis. Hopefully this works.

If this resolves your query, please click on "Accept as Solution" for confirmation. Thanks!