Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Dmasvinc
Contributor III
Contributor III

Sales of new/lost client

Hi

I need to calculate, SUM of a new and lost customer sales past two years.

Lost= made sales last year, but not the selected year

New= sales made selected year but not last year

For example :

Formula must show, old client sum = 2935+3520

New clients = 5373+2950+5290+2554+2037

 

4 Replies
Vegar
MVP
MVP

Try expressions like this:

 

New

sum({<Year={$(=max(Year))}, Client*=E({<Year={$(=max(Year)-1)}>})>}Amount)

Lost

sum({<Year={$(=max(Year)-1)}, Client*=E({<Year={$(=max(Year))}>})>}Amount)

Dmasvinc
Contributor III
Contributor III
Author

doesnt work shows 0 values

 

Vegar
MVP
MVP

I'm sorry, but you did not include many details in your explanation.

It looks in you screenshot that you don't have a field named Year. What about the client field Client? As you have left out many inportant details you need to adjust my suggested solution to your data model and field names.

 

Dmasvinc
Contributor III
Contributor III
Author

I just can add qvf file with data.

I use field item ledger sales amount, date year and customer.name.

Please can you build calculation in this file ?