Qlik Community

Qlik Server Side Extensions Discussions

Discussion Board for collaboration on Server-Side Extensions and Advanced Analytics Integration.

istvan_borsos
New Contributor II

Qlik Sense - Forecasting with R

Hi All,

we would like to implement a line chart which shows a trend about actual data and also for the future it has to show forecasted values generated by R script ( for ex.: fit = nnetar(rev(q$close));  rev(data.frame(forecast(fit,h=$(Forecast_Days)))[,1]))

).

Can it be done in one chart ?

We only was able to do this in two, first had the actual data from the data model second had the forecasted values.

Regards,

Istvan

1 Solution

Accepted Solutions
danielrozental
Honored Contributor II

Re: Qlik Sense - Forecasting with R

Here's my take on this, add some empty lines in the response.

Sorry, not really an R programmer.

10 Replies
lironbaram
Honored Contributor II

Re: Qlik Sense - Forecasting with R

hi

it can be done ,

you'll need to create a extra values in your date field , and then

you can display both actual and forecast

dberkesacn
Contributor III

Re: Qlik Sense - Forecasting with R

Hi lironbaram,

like this:

JustForTest:

Load * Inline [

Year, Measure, YearForForcast

2010, 100, 2010

2010, 50, 2010

2011, 100, 2011

2011, 60, 2011

2012, 88, 2012

2012, 77, 2012

2013, 200, 2013

2013, 10, 2013

2014, 16, 2014

2014, 250, 2014

2015, 250, 2015

2015, 230, 2015

,, 2016

,, 2017

,, 2018

,, 2019

,, 2020

];

BTW we are using 17 Jun.

Regards,

Daniel

lironbaram
Honored Contributor II

Re: Qlik Sense - Forecasting with R

yes

or you can create different table with prediction dates

and just call the field with the same name

when creating a report the values from the two tables will be combined

istvan_borsos
New Contributor II

Re: Qlik Sense - Forecasting with R

Hi,

We tried it, but always put the forecasted data to the begining of the timeline, as the pictures shows:Capture2.PNG

Capture3.PNG

Is it possible to put the two line one after the another?

Regards,

Istvan.

lironbaram
Honored Contributor II

Re: Qlik Sense - Forecasting with R

can you share the app

istvan_borsos
New Contributor II

Re: Qlik Sense - Forecasting with R

Hi,

Yes. We made some changes, but basically the problem is still the same.

Regards,

Istvan.

lironbaram
Honored Contributor II

Re: Qlik Sense - Forecasting with R

HI

if you change the number of periods you want to forecast

then it draws a line for future periods also

so what excatly is missing from your point of view

istvan_borsos
New Contributor II

Re: Qlik Sense - Forecasting with R

Hi,

We want to place the actual data and forecasted data in one chart and in one line, but when we tried this, the forecasted data always placed in the beginning of the line chart, not the end of it e.g. 2018 since it is a forecast.

So we have this:

Capture4.PNG

But we want like this:

capture5.jpg

We also tried to binding the actual data with the forecasted data within R script and used calculation condition for the coloring, but the order of the rows of the result wasn't correct.

Regards,

Istvan.

danielrozental
Honored Contributor II

Re: Qlik Sense - Forecasting with R

Here's my take on this, add some empty lines in the response.

Sorry, not really an R programmer.

Community Browser