Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Irisha55ets
Contributor
Contributor

Creating Additional Records based on a loaded table

Hello Experts,

I have a table of quarterly sales data. I am trying to generate additional rows for multiple quarters into the future. 

Sample existing records:

03/31/2021 100
06/30/2021 105
09/30/2021 109
12/31/2021 112
03/31/2022 115
06/30/2022 120

 

How can I use the load script to create estimated future records? (without using an inline load)

Thank you!

Labels (1)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Assuming existing column names of "Quarter" and "Value", how about:

Concatenate (BaseTable)
LOAD
  Date(AddMonths(MaxQuarter, IterNo()*3)) as Quarter,
  0 as Value
While IterNo() <= 4 // Add 4 more Quarters
;
LOAD
  Max(Quarter) as MaxQuarter
Resident BaseTable;

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Assuming existing column names of "Quarter" and "Value", how about:

Concatenate (BaseTable)
LOAD
  Date(AddMonths(MaxQuarter, IterNo()*3)) as Quarter,
  0 as Value
While IterNo() <= 4 // Add 4 more Quarters
;
LOAD
  Max(Quarter) as MaxQuarter
Resident BaseTable;

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

Irisha55ets
Contributor
Contributor
Author

It is an honor to receive an assist from the man in the white hat. 

Very much appreciate the help, Rob!

DM