Discussion board where members can get started with QlikView.
I want a field year and sales. I want to create a new field accumulatesales which should be sum of current year sales + previous year sales.
How to create this new field in the script?
Please provide your suggestions.
sum(sales) as sales,
from ****YOUR SOURCE**;
sum(sales) +Previous(sales) as New_Sales
order by year asc;
it depends on your data
this could be a solution
load * inline [
load Year, Sales + Previous(Sales) as TwoYearSales Resident z order by Year;
if(IsNull(Sales + Previous(Sales)),Sales,(Sales + Previous(Sales))) as PreviousSales
Resident z Order by Year;