Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, good afternoon!
I'm having problems with a KPI.
I have three selectors: year, month and day. The selectors of the year and month, by default, have a fixed fixed value. On the other hand, the day one does not.
I need to create four indicators, for example if I select year = '2017', month = 'dec' and day = '04/12/2017'. I have to show:
The first three, I could calculate without any problem. On the other hand, for the last one, sales to the day of the previous year, I could not. I tried in the set analysis with year-1 and day-365, but I get 0. The strange thing is that in the label, using this function: Date (DIM_DATE - 365), the KPI tells me the correct date , that is, 04/12/2016.
Any solution that comes to mind?
I already appreciate your time and contributions.
Regards,
Martin.
Forgot that you are selecting year... try this
Count({<CONDICION_FINAL = {'A'}, DATE_ACL = {"$(=Date(AddYears(Max(DATE_ACL), -1), 'DD/MM/YYYY'))"}, YEAR_DATE>} DISTINCT EMPLID)
What is the expression for the other three?
Count({<CONDICION_FINAL = {'A'}, FLAG_MONTH_END = {1}, DATE_ACL=>} DISTINCT EMPLID)
Count({<CONDICION_FINAL = {'A'}, FLAG_MONTH_END = {1}, YEAR_DATE={$(=max(YEAR_DATE)-1)}, DATE_ACL=>} DISTINCT EMPLID)
Count({<CONDICION_FINAL = {'A'}>} DISTINCT EMPLID)
May be try this
Count({<CONDICION_FINAL = {'A'}, DATE_ACL = {"$(=Date(AddYears(Max(DATE_ACL), -1), 'DD/MM/YYYY'))"}>} DISTINCT EMPLID)
I pass the capture of the filters that I have selected. Apply the expression you passed to me and keep giving me 0.
Forgot that you are selecting year... try this
Count({<CONDICION_FINAL = {'A'}, DATE_ACL = {"$(=Date(AddYears(Max(DATE_ACL), -1), 'DD/MM/YYYY'))"}, YEAR_DATE>} DISTINCT EMPLID)
Great as always, stalwar1! Thank you very much for your help