Skip to main content

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
istvan_borsos
Contributor II
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

Labels (1)
1 Solution

Accepted Solutions
danielrozental
Master II
Master II

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

Sorry, not really an R programmer.

View solution in original post

10 Replies
lironbaram
Partner - Master III
Partner - Master III

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
Partner - Creator III
Partner - Creator III

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
Partner - Master III
Partner - Master III

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
Contributor II
Contributor II
Author

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
Partner - Master III
Partner - Master III

can you share the app

istvan_borsos
Contributor II
Contributor II
Author

Hi,

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

Regards,

Istvan.

lironbaram
Partner - Master III
Partner - Master III

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
Contributor II
Contributor II
Author

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
Master II
Master II

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

Sorry, not really an R programmer.