Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
Partner
Partner

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)

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
Contributor III
Contributor III

doesnt work shows 0 values

 

Highlighted
Partner
Partner

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.

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Highlighted
Contributor III
Contributor III

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 ?