Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All ,
I have a requirement I have to show Month wise customer count in table where in one expression need to display count of customer code and in next expression need to display customer count of last 3 month in respect of that month .
For example if first row for Jan 2015 ,last 3 month count of customer would be Nov ,Dec and Jan .
in next row Feb 2015 ,last three month would be Dec ,Jan and Feb .
I used rangesum function but it is giving me sum of last 3 row which is incorrect .
RangeSum(above(Count(distinct{<_Flag={'SD WOD_DOD'}>}CustomerCode),0,3))
then I pass condition for last 3 month in set analysis but it is giving same value as month wise value .
Count(distinct{< _Flag={'SD WOD_DOD'},CommonDate ={">=$(=num(MonthStart(Date(Max(CommonDate)-90))))<=$(=num(MonthStart(Date(Max(CommonDate)))))"}>}CustomerCode)
Please check both expresion which I used ,help me out .
If any another solution can be provided, would very helpful .
Thanks in Advance
Chanchal
Hi,
Change this script.
InterMediate:
Load InterMonth as InterMonth,
'$(vMonth)' as Show_Month_Chart,
If(InterMonth = '$(vMonth)',1,0) as Flag
Resident CAL where InterMonth >= AddMonths($(vMonth),-2) and InterMonth <= $(vMonth);
In chart Add below expression to get monthly count.
Count(Distinct {<_Flag={'SD WOD_DOD'},Flag = {"1"}>} CustomerCode)
Hope this will solve the issue.
Regards,
Kaushik Solanki
try this?
=Count(distinct{< CommonDate= ,_Flag={'SD WOD_DOD'},
CommonDate ={">=$(=Date(Max(CommonDate)-90,'DD/MMM/YYYY'))<=$(=Date(Max(CommonDate),'DD/MMM/YYYY'))"} >} CustomerCode)
Note: Format of Common Date should be 'DD/MMM/YYYY'
HI,
Second expression should work, but all you need to do is suppress the selections of other filters related to the year, month , quarter...
So your expression will be like below.
Count(distinct{< _Flag={'SD WOD_DOD'},CommonDate ={">=$(=num(MonthStart(Date(Max(CommonDate)-90))))<=$(=num(MonthStart(Date(Max(CommonDate)))))"}, Year = ,Month = , Quarter=>}CustomerCode)
Regards,
Kaushik Solanki
Use of Num() will work only if CommonDate is into numeric form, else it will not work
Hi All ,
Thanks a lot for quick response.
I have checked expression share by both of you . But it is not giving correct answer .
I have attached output of data for reference please check column C and D.
Thanks in Advance
Chanchal
Hi,
Can you please upload sample application and also let us know what output you are looking for (With values)
Regards,
Kaushik Solanki
Yes Sure ,
Please find attached file .
Also I have mentioned last 3 month values for 3 months .
Dec | Nov | Oct | ||
823 | 841 | 871 |
Thanks in Advance
Chanchal
Can you please explain how did you got the numbers like Dec 823..
What is the logic behind this.
Regards,
Kaushik Solanki
Sure .
823 is distinct count of customer code of Dec ,Nov and Oct month for December.
In Excel I did this mannualy .
Same number I need in qlik in Last 3 months .
Hi,
I have made some changes in script to make it work.
It cant be achieve using set analysis, because the Max or any other aggregate function in set analysis is evaluated at overall level not at dimension level.
Hope this will solve your issue.
Regards,
Kaushik Solanki