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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
CloudYX
Contributor
Contributor

Error: no value for the variable

Hi,

I am trying to count the number of distinct customer that have made order in the past 6 months using the following set analysis. It seem correct but it is not "recognizing" the variable (vMaxDate). Have separately testing the expression (AddMonths($(vMaxDate), -6)) and is returning correct value. Can anyone help?

 

Count(DISTINCT {<OrderDate-= {">=$(AddMonths($(vMaxDate), -6))"}>} CustomerID)

Labels (2)
1 Solution

Accepted Solutions
mpc
Partner Ambassador
Partner Ambassador

Hi, 

Can you try: Count(DISTINCT {<CustomerID -= {">=$(=(AddMonths($(vMaxDate), -6)))"}>} CustomerID)
If CustomerID is a date instead. 

Best

From Next Decision and mpc with love

View solution in original post

2 Replies
mpc
Partner Ambassador
Partner Ambassador

Hi, 

Can you try: Count(DISTINCT {<CustomerID -= {">=$(=(AddMonths($(vMaxDate), -6)))"}>} CustomerID)
If CustomerID is a date instead. 

Best

From Next Decision and mpc with love
CloudYX
Contributor
Contributor
Author

Yes, It works now. Thank you. Yup, there is a typo in the text too as it should be OrderDate and not CustomerID.