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

Monthly Wins & Losses - set analysis

Given the following dataset:

Reporting Date Channel Client Name Service Sale Amount
01/01/2020 AAA C1 LAD 16
01/01/2020 AAA C2 LAD 11
01/01/2020 BBB C1 LAD 6
01/01/2020 BBB C2 LAD 1
01/01/2020 BBB C5 LAD 2
02/01/2020 AAA C1 LAD 8
02/01/2020 AAA C3 LAD 1
02/01/2020 AAA C5 MEDICAL 8
02/01/2020 AAA C4 LAD 7
02/01/2020 BBB C1 MEDICAL 18
02/01/2020 BBB C2 LAD 8
02/01/2020 BBB C3 LAD 10
02/01/2020 BBB C4 LAD 17
03/01/2020 AAA C1 LAD 12
03/01/2020 AAA C3 LAD 5
03/01/2020 AAA C5 LAD 10
03/01/2020 BBB C1 MEDICAL 2
03/01/2020 BBB C3 LAD 15

 


I need to calculate the New Clients (wins) and Lost Clients (losses) who contracted the service in comparission with previous month

DiegoToll_0-1712264183419.png

i.e.

DiegoToll_1-1712264776994.png

My Expression works for fixed months:

DiegoToll_2-1712264961147.png

 

But fails when I try to make it dynamic.

DiegoToll_3-1712265347895.png

I will appreciate any guidance.





 

Labels (1)
1 Reply
MatheusC
Specialist III
Specialist III

@DiegoToll 

Based on your print data, given that MonthName's current period is March 2020, you can use max(MonthName).

Look this:

$(=Date#(MonthName(AddMonths(max(FieldMonthName),0)),'MMMM')) – Current

$(=Data#(MonthName(AddMonths(max(FieldMonthName),-1)),'MMMM')) - Previous

Regarts, Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!