Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
HanLaso
Contributor
Contributor

Accumulation with fixed step - RangeSum

Hi all , 

How can I populate in a table for each available day accumulation of the Target with 1500 . So on 01.12 i get  345 000, 02.12  346 500 and so on ?

Thanks ! 

HanLaso_0-1671023378778.png

 

 

Labels (4)
1 Reply
JordyWegman
Partner - Master
Partner - Master

Hi,

Yes of course, check the code below:

Sales:
Load * Inline [
OrderDate
1/1/2022
31/12/2022
];

Final:
LOAD 
Date(MinDate + IterNo()-1) as OrderDate,
IF( RowNo() = 1
	, 343500
    , Peek( Value ) + 1500
)							as Value
While(MinDate + IterNo()-1) <= Num(MaxDate)
;
LOAD
   Min(Floor(Date# (OrderDate, 'D/M/YYYY'))) As MinDate,
   Max(Floor(Date# (OrderDate, 'D/M/YYYY'))) As MaxDate
Resident Sales ;

Drop table Sales;

Jordy

Climber

Work smarter, not harder