Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all, I am using below set expression for calculate rolling 12 months.
count({$<Year=, Month=, Day=,MonthYear=,
Date={">=$(=addMonths(max(Date),-12)) <= $(=max(Date))"}>}
distinct Txt_IssueID)
I have a table where i have dimension as MonthYear & measure which is mentioned above.
Now in UI i have a filter pane with year, month. When I selected Month as Feb. expectation is that the table should show data between Feb 2022 till Feb 2023. If i see the date range in the expression editor window it is showing correctly.
But when i see the records in the table it is not showing correctly, Can anyone suggest the reason for the same ?
Thanks in advance.
I found one from @sunny_talwar post back in 2019 which resolved this. below is how the complete version look like.
Count({<Year, Month, Week, Quarter,
Date={"$(='>=' & Date(MonthStart(addmonths(Max(Date), -12))) & '<' & Date(Max(Date)))"}>}
distinct Txt_IssueID)
it is because you have nullify the selection in set analysis.
Remove "Year=, Month=, Day=,MonthYear=,"
Regards,
Prashant Sangle
thanks for your revert. when i removed the parameters and checked, below is what i get,
Count({<
Date={">=$(=addMonths(max(Date),-12)) <= $(=max(Date))"}>}distinct Txt_IssueID)
@Kaushik2020 Please remove Year=, Month=, Day=,MonthYear= from your Set Modifier and that should resolve the issue.
thanks for your reply, when i removed those filters, I can see only Feb-2022 and Feb-2023.
Below is output and set expression for your reference.
Count({< Date={">=$(=addMonths(max(Date),-12)) <= $(=max(Date))"}>}distinct Txt_IssueID)
I found one from @sunny_talwar post back in 2019 which resolved this. below is how the complete version look like.
Count({<Year, Month, Week, Quarter,
Date={"$(='>=' & Date(MonthStart(addmonths(Max(Date), -12))) & '<' & Date(Max(Date)))"}>}
distinct Txt_IssueID)