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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
q11hhg
Contributor III
Contributor III

AddMonths last 12 months

Hi there 

I want to calculate the last 12 months customers by using this formula, but it does not work properly, the result is not correct. I do not know how to fix it, can anyone please help me?  Is this caused by my [Date] column? 

Count(distinct{<Date={">=$(=date(addmonths(Max(Date),-12)))<=$(=date(Max(Date)))"}>}Order_Customer_ID)

q11hhg_0-1614267234139.png

 

2 Replies
micheledenardi
Specialist II
Specialist II

The set analysis seems correct.

Can you please post some example data and the expected result?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
q11hhg
Contributor III
Contributor III
Author

I think something is wrong with my Date, after I adjusted the formula like this, it worked 

 

 

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