Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
@sunny_talwar Hi, I am new to Qlik sense and I am trying to match DateEntered field( date selected from date range picker ) with each date of another holiday_date column. Want to take the count only where holiday_date is in the same year as the date selected.
I tried something like :
aggr(sum(if(inyear([holiday_date ], '9/1/2021',0)=-1,1,0)),[customer_id],[customer_status='A'],[customer_system])
and gives expected result to me but in my case i should give selected date as base date here and that is not working as expected.
aggr(sum(if(inyear([holiday_date ], [DATE_ENTERED],0)=-1,1,0)),[customer_id],[customer_status='A'],[customer_system])
please suggest how to implement this requirement
@Pragyan try below
aggr(sum(if(inyear([holiday_date ], max([DATE_ENTERED]),0)=-1,1,0)),[customer_id],[customer_status='A'],[customer_system])
or
aggr(sum(if(inyear([holiday_date ],max(total [DATE_ENTERED]),0)=-1,1,0)),[customer_id],[customer_status='A'],[customer_system])
@Kushal_Chawda Hi Kushal, Thanks for your reply I tried your solution but no luck. I am not sure what causing the issue but static date value is working perfectly fine in place of base date.
First I thought may be date format issue with my selected date but even the format are same for both the date fields I am not getting the expected output.
Would really appreciate any suggestions.
Format of date doesn't matter in this case as long as the underlying values of both the fields are numeric. Have you checked Max[DATE_ENTERED]) expression in a KPI Object? Does it return anything? If it doesn't then may be DATE_ENTERED isn't read as a date field and you need to get that resolved. Once you do that, you can try the expressions provided by @Kushal_Chawda above.