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

MonthToDate Set analysis to count no. active customers - with condition.

Hi guys,

I have created MTD set analysis to count customers as below:

Count(distinct{<Year=, Month=, Quarter=, Week=, Month=, DateNum={">=$(=Num(MonthStart(Max(DateNum))))<=$(=Max(DateNum))"}>} CUST_ID)

Now, client wants a KPI Object - A MTD(Month To Date) set analysis to count no. of ACTIVE customers.

Condition of ACTIVE customer is - MUST HAVE at least 1 sales transaction within 3 months.

Example Scenario: suppose MTD Customer count period is 1 Jan 2017 - 31 Jan 2017. so, the no. of active of customer should count within this 3 months - Jan2017, Dec 2016, Nov2016.

Pls help guys.!

Rgds

Jim

35 Replies
jim_chan
Specialist
Specialist
Author

0 ?? bro. i dont get it.. can you tell me why??

sunny_talwar

-2 was taking it back to MonthStart for 2 months ago.... 0 will be this month's month start 30 days for this month

jim_chan
Specialist
Specialist
Author

i seee... thanks guru!

jim_chan
Specialist
Specialist
Author

Hello Sunny,

the last 30 days set analaysis didnt seem like working . have a look on my scvreenshot..

both MTD within 3 months and lasy 30 days have the same figuress....

sunny_talwar

May be all the customer's which had transaction in last 3 months also had transaction in last 30 days? Is that no possible? Do you know what number should show up?

jim_chan
Specialist
Specialist
Author

this is my qvw file. have a look bro.

sunny_talwar

At least, let me know what the expected number needs to be?

jim_chan
Specialist
Specialist
Author

MTD is correct , MTD + last 30 days is not correct.

u sure the set analysis u given for last 30 days is correct?

there is no expected resukt given by the user...

sunny_talwar

My only question is why can't the two be same numbers? Set analysis could be wrong, but I won't know unless I know what the expectation is....

jim_chan
Specialist
Specialist
Author

i think could be the set analysis, not working for last 30 days.

i have changed it to

=Count(DISTINCT {<SYNCOPERATION -={'D'},Year, Month, DateNum = {'>=$(=Num(MonthStart(Max(DateNum))))<=$(=Max(DateNum))'}, CUST_CD = {"=Count(DISTINCT {<PRD_SLSTYPE={'S'},Year, Month,DateNum = {'>=$(=Num(MonthStart(Max(DateNum), -1)))<=$(=Max(DateNum))'}>} INV_KEY) > 0"}>} CUST_CD)

but nothing change