So essentially I would want the output as field name, in order to use the class function to create variance ranges because i can't seem to use the expression below expression in the calculated expression with the class function ie
=NUM(SUM(vCurrentDate) Amount - SUM(vPreviousDate) Amount) / SUM(vPreviousDate) Amount as Myfield
Scripting we do to model and transform the data in the data tables so that desired KPIs can be shown through charts. If you need variance calculation against specified dimensions/fields in script, you need to use sum, group by, peek/previous kind of functions in the script. Please share sample data and script to help further.
Does this look like what you wanted?
(ooxml, embedded labels, table is Sheet1);
If(CustomerName = Peek('CustomerName'), (SUM(BALANCE) - SUM(Alt(Previous(BALANCE), 0)))/SUM(Alt(Previous(BALANCE), 1)), 0) AS VarianceBalance
GROUP BY DATE, CustomerName;
LOAD DATE(NUM#(DATE),'dd/MM/yyyy') AS DATE,
Order By CustomerName, DATE;
DROP TABLE TEMP;
TEMP.qvw 153.8 K