Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count increasing/decreasing customers based on Sales YTD vs. LYTD

Hello Guys,

I'm stucked with the following calculation...

I'm working with a variable YTD and LYTD Sales calculation. Now I would like to create a calculation (text object) with the number of customers which are increasing and decreasing when you compare both Sales calculations.

YTD: =SUM({<Year={'$(vMaxYear)'},Date={'<=$(vMaxDate)'},Month=,YearMonth=>}Sales)

LYTD: =SUM({<Year={'$(vPriorYear)'},Month=,Date={"<=$(vPriorYearDate)"},YearMonth=>}Sales)

When im using a chart with the Customerno. or name, I already created a expression to show when the customer is an increasing or decreasing customer. But now I would like to create this calculation without a 'customer' dimension, like in a text object. Logicaly you need to include count (distinct Customerno.) in the calculation, but unfortunately I didn't figured it out to create the correct expression yet.

Can you guys help me with this one?

5 Replies
Anil_Babu_Samineni

May be this?

Sum({<Year={'$(vMaxYear)'},Date={'<=$(vMaxDate)'},Month=,YearMonth=>} Aggr(Count({<Year={'$(vMaxYear)'},Date={'<=$(vMaxDate)'},Month=,YearMonth=>} DISTINCT Sales), Customerno, name))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hello Anil,

Thanks for your suggestion, but this expression can't be a correct, when I look at the output. I also think the Distinct statement is put on the wrong place. The calculation needs to provide a count distinct of the number of customers (based on Customerno) and not a Distinct on Sales..

Do you or someone else have another idea how to solve this one?

Thnx!

Anil_Babu_Samineni

Will you able to provide sample?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Hello Anil/ Others,

Hereby you'll find a sample application.

Would be awesome if someone would solve this one!

Best regards,

Guy !

Anil_Babu_Samineni

PFA

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful