Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there , I have a calculation as below
count({$<
[Event Type] = {'Login'}>*
<[Customer ID] = {"=sum([Total Events])>=2"}
>} distinct [Customer ID] )
and I want to add a date filter inside to only count the last 12 months:
count({$<
[Event Type] = {'Login'}>*
<[Customer ID] = {"=sum([Total Events])>=2"},
Date={">=$(=date(addmonths(Max(Date),-12),'DD/MM/YYYY'))<=$(=date(Max(Date),'DD/MM/YYYY'))"}
>} distinct [Customer ID] )
but it does not give me the expected result, could you please help me?
I'd suggest you to check the below expressions in a text object first.
=date(addmonths(Max(Date),-12),'DD/MM/YYYY')
=date(Max(Date),'DD/MM/YYYY')
what do you get?
did you try to replace time period with values ex. Date={">=01/01/2020<=26/02/2021"} and see what you get?
Yes I did, it returns the same result as without the date filter.
I'd suggest you to check the below expressions in a text object first.
=date(addmonths(Max(Date),-12),'DD/MM/YYYY')
=date(Max(Date),'DD/MM/YYYY')
what do you get?
looks like these , seems like a real date?
and the expression is also fine ?
I'd say yes, maybe you are getting the right result based on your data.
let's try changing the time period ex. >=14/02/2020<=14/02/2020 to see what happens...
Thank you, I just double-checked, it is correct.
Hi @agigliotti , the calculation in the chart is fine , but when I use a table chart, the max date does not work. It only gives me the count of that month, not the last 12 month.
for example , in the first row 2020-Dec, the result should be 7952, but it only show the month of December 2020.
how should I fix this?