We have created a table which groups Total Items Sold by Month/Year and Stock Code - as demonstrated in the below table. However, we now want to use this historical data to calculate a forecast for the next 6 months of Total Items Sold by generating the values at the script level.
We already have a formula for forecasting but we're open to alternatives - an example of this formula is provided below - with March 2018 being an example of a future month at the time of writing. But I'm not entirely sure how to achieve this in Qlik Script:
(March 2018) * ((Feb 2018 + Jan 2018 + Dec 2017 + Nov 2017 + Oct 2017 + Sep 2017) / (Feb 2017 + Jan 2017 + Dec 2016 + Nov 2016 + Oct 2016 + Sep 2016))
What is the best scripting solution to get this result, please? Any advice would be great.
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others
Thanks Sunny From my understanding of Linest_M and Linest_B it's used to plot graph values? Ideally, in the load-script, I want to continue the table as shown in the original post to include the next 6 months in the future using previous records. Instead of trying to plot the trend within a chart object.