I'm pretty new to Qlik and I'm currently struggling to add certain new rows to a table in a load script.
For simplicity, let's say I have four columns in my original table:
- name (e.g. customer name)
- value (e.g. number of items bought by the customer)
- month
- KPI (describes whether the given value is historical data or a forecast)
My original data may look for instance like this:
![saz_0-1678117729840.png saz_0-1678117729840.png](https://community.qlik.com/t5/image/serverpage/image-id/102085i5BAC8B22D2C9E3FE/image-size/medium?v=v2&px=400)
Each of the forecasts (Forecast 1 // Forecast 2 // etc) starts at some point during the year. My aim is to impute the data of the earlier months with the historical data. Example: Forecast 1 starts in February and so there is no value for Forecast 1 in January. I would like to add the historical data from January to the table, i.e. add the lines
![saz_1-1678117946945.png saz_1-1678117946945.png](https://community.qlik.com/t5/image/serverpage/image-id/102086iFFE01B3406B98851/image-size/medium?v=v2&px=400)
Doing the same for the other forecast, I will end up the following table:
![saz_2-1678118116913.png saz_2-1678118116913.png](https://community.qlik.com/t5/image/serverpage/image-id/102090iE0D0948B94CEB197/image-size/medium?v=v2&px=400)
I'm a bit lost how to realize this in the load script. It will certainly require some loop(s), but I'm not really sure what is the best way to do it. I would be happy about any help! 🙂