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: 
jacek_stypulkow
Contributor II
Contributor II

Lost customers

Hi,

hope you can help,

I'm looking for a number of lost customers comparing current year with previous year.

The below expression seems to be working, but it is not. It returns null.

count({<Year={'$(=max(Year)-1)'},[Customer Name]=E({<Year={'$(=max(Year))'}>}

[Customer Name])>} distinct ([Customer Name]))

Can you advise on this please?

regards

Jacek

4 Replies
sunny_talwar
MVP
MVP

Not sure if this is a typo, but you have an extra parenthesis at the end

count({<Year={'$(=max(Year)-1)'},[Customer Name]=E({<Year={'$(=max(Year))'}>}

[Customer Name])>} distinct ([Customer Name]))

Remove it and then try your expression

jacek_stypulkow
Contributor II
Contributor II
Author

Thanks Sunny,

did it, but no change.

Jacek

sunny_talwar
MVP
MVP

Do you see any error message shown by expression editor?

sunny_talwar
MVP
MVP

Also, I just realized that the parenthesis is not incorrect... you need it

Count({<Year = {$(=Max(Year)-1)}, [Customer Name] = e({<Year = {$(=Max(Year))}>} [Customer Name])>} DISTINCT [Customer Name])

But your expression looks right... would you be able to share a sample where this isn't working?