Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld May 10-12, Online and Free! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jacek_stypulkow
Contributor
Contributor

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

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
Contributor
Author

Thanks Sunny,

did it, but no change.

Jacek

sunny_talwar

Do you see any error message shown by expression editor?

sunny_talwar

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?