Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts, Just wanted help in calculating previous value. I am having sum of sales as my expression It will always show me current value What i want to do is add one more expression which is previous sales . I don't want to do this at script level but at frontend using set analysis The calculation of current /previous value will be based on date selection. Ex if i select today's date then previous should show me yesterdays sale. Pls help. Regards Raj
load
Year ,
peek(Year ) a previous
sales
from path;
in expression
sum({<Year={$(=Only(Year)}>} sales) - current value
sum({<Year={$(=Only(previous)}>} sales) -previous valuee
or
tab1:
Load
Year,
sales
from path
let var=peek('fieldname',-1,Tablename);
in expression
sum({<Year={$(=Only(Year)}>} sales) - current value
sum({<Year={$(var}>} sales) -previous value
hope this helps
use this for previous calculattion
=sum({<Day= {'$(=Date(max({<Day = {"<$(=max(Day))"}> } Day)))'}>} Price)