Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
a simple question for those who are more experienced than me. I would like to display the sum of the defects of the previous month chosen. The sum of defects of the selected month works but as soon as I add "-1" for the previous month, the result becomes 0. I think this must be due to a syntax problem.
Can you help me?
Set analysis: Count({$<[Data.Mois]={$(=Only([Data.Mois])-1)}>}[Data._kizeo_id])
Count({$<[Data.Mois]={"$(=Only([Data.Mois])-1)"}>}[Data._kizeo_id])
is Month a Text field or a Numeric field ?
Also simply substracting MonthNumber -1 will fail if you select January which will be 1-1 = 0
You should actually be using the actual Date field to refer previous month
Latest/Selected Month
Count({<Datefield={">=$(=Date(Monthstart(Max(Datefield)))<=$(=Date(Max(Datefield)))"}>}[Data._kizeo_id])
Previous Month
Count({<Datefield={">=$(=Date(Monthstart(Max(Datefield),-1)))<=$(=Date(Monthend(Max(Datefield),-1)))"}>}[Data._kizeo_id])
Hi Vinieme12,
Thanks for your feedback.
I tested : Count({<Datefield={">=$(=Date(Monthstart(Max(Datefield),-1)))<=$(=Date(Monthend(Max(Datefield),-1)))"}>}[Data._kizeo_id])
but the result is always the current month and not the previous month.
Attached is the screenshot which shows that the months M-1, M -2 and M-3 are always identical to the selected month.
Thanks in advance for your help
Can you post the exact expression you used? A full snapshot of the expression editor
Attached the snapshot of the expression editor for the last month.
Thanks for advance for your help
You need to replace Datefield with THE ACTUAL DATE FIELD
Just like you have Data.Mois you must have a field that has date values! Use that field