Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am currently building a chart that excludes some dates as follows:
count({$<stock_date={"<=$(=date(($(=varMaxDate)-week_number),'DD/MM/YYYY'))"}>} scan_id)
/ count({<stock_date={"<=$(=date(($(=varMaxDate)-week_number),'DD/MM/YYYY'))"}>} total <Category> scan_id)
The equation results as a percentage, and it is on a chart where week_number is on the x-axis. However this expression doesn't work since when we use total the week_number could be any one. Is there a way to take week number from the first expression and use it in the total expression?
Hi @Giansonn ,
Would this be something you could calculate in the script and save into a variable?
Replace total <Category> with total <WeekNumber>
@Wlad_Masi unfortunately no I dont think that there is a way, especially with trying to retain filtering.
@Kushal_Chawda Unfortunately that would not work because I want all the data but I want to use a restriction based on the current x-axis value. Unfortunately when you use total you can no longer refer to the categorical variable in an expression since it uses all of the categories.
so try including weeknumber as well in total like total <Category,WeekNumer> or try below expression
sum(total <WeekNumber>aggr(count({<stock_date={"<=$(=date(($(=varMaxDate)-week_number),'DD/MM/YYYY'))"}>} scan_id),Category,WeekNumber))
Super kudos for trying but I don't think now that this is possible.
The chart has been deleted now but I have a copy of it stored so if a solution ever does become available I will let you guys know.
Thanks for all your help.