Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
All,
I have a table where I am trying attempting to get the table to default to the lasted month's data. Then, when the user selects other months the table refreshes and list the data for the selected months.
I have it somewhat close. I have variable vCurrentMonth defined as "$(=MonthName(AddMonths(max(MonthName),0)))" and use expressions like Only({<MonthName = {$(vCurrentMonth)}>}Vulnerability).
This does default the table to the latest data month as it uses max(Month) in the variable. However, because the variable uses max(Month) in the variable when multiple months are selected the table will always only display the latest month from the months selected.
Do you have any suggestions that would default the table to only display the data for the latest month in the data and when the user selects multiple months display the data for all months selected?
Thanks
Notice that if a selection is made in Month field, then the expression that will be used doesn't have any set analysis:
If(GetSelectedCount(Month) = 0, Only({<MonthName = {$(vCurrentMonth)}>}Vulnerability), Only(Vulnerability))
Are you sure this isn't working? May be you need another aggregation function like Avg or Sum?
If(GetSelectedCount(Month) = 0, Only({<MonthName = {$(vCurrentMonth)}>}Vulnerability), Sum(Vulnerability))
Try this may be:
If(GetSelectedCount(Month) = 0, Only({<MonthName = {$(vCurrentMonth)}>}Vulnerability), Only(Vulnerability))
Thanks Sunny, but I'm getting the same result I believe it's because vCurrentMonth is defined as "$(=MonthName(AddMonths(max(MonthName),0)))"
because of the max the variable will only ever display the latest month.
Notice that if a selection is made in Month field, then the expression that will be used doesn't have any set analysis:
If(GetSelectedCount(Month) = 0, Only({<MonthName = {$(vCurrentMonth)}>}Vulnerability), Only(Vulnerability))
Are you sure this isn't working? May be you need another aggregation function like Avg or Sum?
If(GetSelectedCount(Month) = 0, Only({<MonthName = {$(vCurrentMonth)}>}Vulnerability), Sum(Vulnerability))
Apologies Sunny, your code does in fact accomplish the goal. Turns out I had an issue with one of the lists boxes which was impacting the table.
Thanks once again!