Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
q11hhg
Contributor III
Contributor III

table chart with max date expression

I have a measure that calcuates the last 12 months customers: 

count({$<

[Event Type] = {'Login'},

[Customer ID] = {"=sum([Total Events])>=2"},

Date={">=$(=date(addmonths(Max(Date),-12),'YYYY-MM-DD'))<=$(=date(Max(Date),'YYYY-MM-DD'))"}

>} distinct [Customer ID] )

 

When I add this to a table chart, each row only shows the number of customers in that month, instead of calculating back 12 months.

q11hhg_0-1614601581280.png

The expected result should be , for example, in the first row 2020-Aug, the measure should calculate starting from 2019-Aug until 2020-Aug.

 

 

Labels (1)
1 Reply
Chanty4u
MVP
MVP

Use this as your calculated dimension  and try to filter other values and check 

If(Date >= AddMonths(Today(), -12), Date)

 

or try

Script:
If(Date <= Today() And Date >= SetDateYear(Today(), Year(Today())-1), 1, 0) As Last12Months

Set Analysis:

=Count({< Last12Months = {1}>} Date)