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

Adding days to date in set analysis

I am struggling to add days to a date in a Qlik sense expression

This works:

COUNT({$<Purchase_Date={"<=$(varMaxDate)"}>}DISTINCT(POLICY_ID_MED))

 

But if i try to add days to the date field it doesn't return anything, I've tried both of these but neither return anything.

COUNT({$<Purchase_Date+30={"<=$(varMaxDate)"}>}DISTINCT(POLICY_ID))

COUNT({$<DATE(Purchase_Date+30,'DD/MM/YYYY')={"<=$(varMaxDate)"}>}DISTINCT(POLICY_ID))

 

Variable varMaxDate is populated from a variable input box and is in DD/MM/YYYY format and there are definitely valid records that should be returned. But its not even returning a zero count.

What i am doing wrong?

 

Thanks

1 Solution

Accepted Solutions
Vegar
MVP
MVP

You where almost there. Try this

COUNT({$<Purchase_Date={"<=$(varMaxDate)-30"}>}DISTINCT POLICY_ID)

View solution in original post

2 Replies
Vegar
MVP
MVP

You where almost there. Try this

COUNT({$<Purchase_Date={"<=$(varMaxDate)-30"}>}DISTINCT POLICY_ID)
rlawton1
Contributor III
Contributor III
Author

That's great thank you!