Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Mario1011
Contributor
Contributor

need help with expression - show current month values only

Hi All,

I need my KPI object to display the current month value and not a sum of the cumulative YTD number?

Count({<Month = {'=(Max([Posting Date]))'}>}distinct([Position Key]))-count({<Month = {'=(Max([Posting Date]))'}>}DISTINCT Employee)

This value will also be used in a table which reflects YTD values, but this calculation must ONLY display the value for the most recent month

Thanks!

4 Replies
Channa
Specialist III
Specialist III

Count({<Month = {'=(month(today()))'},Year={'=(Year(today()))'}>}distinct([Position Key]))

 

this will help for current month

Channa
Mario1011
Contributor
Contributor
Author

Thanks - i'll save this....BUT 

I meant to say I need to display the value for "Last Completed Month" -

I have used the "Posting Date" as this refers to the date that the Actuals were posted to the Ledger

I'm comparing Budget to Actuals, so had to use the max(ActualsDate) i.e "Posting Date"

Channa
Specialist III
Specialist III

month(addMonths(today(),-1)== it will bring previous month if you want from data base use Max(month)
Channa
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

you could try in this way:

1) create a variable like this

=Month(If(Today()=MonthEnd(Today()),Today(),MonthEnd(AddMonths(Today(),-1))))

2) use that variable in set analysis