Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

Linear forecast expression

Hi,

     i have to show coming next three years(2017,2018,2019) of spend based up (2014,2015,2016) data?

let say i my sample is

                    Year              spend

                       2014              100

                       2015                200

                        2016                 70

how much     2017                  ?

will be  for       2018                   ?

                       2019                    ?\

how to write a linear expression .......

Thanks

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Is this you are expecting?

Expression i used

If(Sum(Spend),Sum(Spend)

,Linest_M(TOTAL Aggr(if(Sum(Spend),Sum(Spend)),Year),Year)*Year

+Linest_B(TOTAL Aggr(if(Sum(Spend),Sum(Spend)),Year),Year))

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

6 Replies
Anil_Babu_Samineni

Is this you are expecting?

Expression i used

If(Sum(Spend),Sum(Spend)

,Linest_M(TOTAL Aggr(if(Sum(Spend),Sum(Spend)),Year),Year)*Year

+Linest_B(TOTAL Aggr(if(Sum(Spend),Sum(Spend)),Year),Year))

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kunkumnaveen
Specialist
Specialist
Author

Hello Anil, thanks for your reply,

but i am not getting what you got..

i used this

load * inline

[

Fyear,fspend

2014,100

2015,200

2016,70

2017

2018

2019

];

Untitled.png

i am not geeting 2017,2018,2019...Why?

kunkumnaveen
Specialist
Specialist
Author

i have done a mistake now i realise it Year field i need to change

Anil_Babu_Samineni

You can use Fyear instead of Year and then look

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
kunkumnaveen
Specialist
Specialist
Author

Hello Anil,

               i wrote below expression in Line Style , so that those years will display in dots,

if(fspend>2016 ,  '<S3>')

but some how this is not working ,can u say wat i am missing  plz

Anil_Babu_Samineni

There is no wrong on your expression, Seems working to me

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful