Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HEy,
I was going through Previous(). I tried to use it in Expression Tab but there no Previous() is defined. But when i used Previous in Load script then there it is defined.
Does that mean i can use Previous() only in Load script or while loading data ??
Please help and also tell me the scenario where it is used most often.
Thanks
Dear Nikhil
Previous and Peek are two variables which always used in script not in the expressions
as both these function refers to the table and u do not have table during expression
Previous is always used to refer last loaded data in the table
Regards
Kushal Thakral
Hi Nikhil,
Note: Previous() is a script function not the chart function.
Sometimes during loading we need the values of certain columns of previous row in current row, for this scenario the Previous() is useful. One best example is previous day sales, check below example
Date Sales
1/1/2014 100
1/2/2014 200
1/3/204 150
Suppose if you want Previous day sales like below
Date Sales Previous Day Sales
1/1/2014 100 -
1/2/2014 200 100
1/3/204 150 200
For above we will use Previous() like below
LOAD
Date,
Sales,
Previous(Sales) AS PreviousDaySales
FROM DataSource;
Hope this helps you.
Regards,
jagan.
Hi Nikhil,
Previous() function is not a chart function, it is a script function. If you want to achieve the functionality of previous() in chart expression then you can use above() function in expression. Find the attached document. will help you to use the previous() functionality in charts using above() function.