Hi guys,
I created a dynamic table and a dynamic pivot table with Qlik Sense as introduced by Patric Nordström (Top 10 Viz tricks) in which my users can select certain dimensions and metrics in order to create their own tables within an app published by myself.
I'd like them to compare sales data from this year to sales data from last year, though.
I have a list of dimensions, including StatYear that contains the statistical year.
The following metric works:
Metrics:
Load * INLINE [
Metric, MetricNo, MetricFormula
Sales, 1, "num(Sum(Sales), '#.##0; -#.##0')"
I tried to include
Sales previous year, 2, "num(sum({$<StatYear={$(=max(StatYear)-1)}>}Sales), '#.##0; -#.##0')"
but it seems like the function that works perfectly fine for diagrams can't be used in the script. Do you have any advice?
Thanks in advance.