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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

GP CM

How do I calculate GP for just the current month?

i tried =Sum(If(Month=(Today()),GrossProfit))

but ts not working.

Any ideas?

Thanks

14 Replies
Not applicable
Author

Try defining also the year in set analysis or in filter.

Not applicable
Author

No. My month=Jul and Month(Today()) returns July also...

Not applicable
Author

i set

Sum(If(Year = Year(Today()),IF(MonthNumber = Num(Month(Today()))-1,GrossProfit)))

for Previous month GP and it works

Its just the current month that doesnt wrk

Anonymous
Not applicable
Author

So both values display as "Jul". In that case it sounds like a simple date mismatch issue.

I assume your month field is a string saying "Jul" instead of an actual date value, while month(Today()) returns "Jul" but with an underlying numeric value, 7.

Take Miha's suggestion and add:

Sum( {<Month = {'$(=text(Month(Today())))'}>} GrossProfit)

Which should work fine with Jonathan's suggestion as well as you need to make sure the string values match up.

Not applicable
Author

Thanks man that worked perfectly