Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
a_brancati
Partner - Contributor
Partner - Contributor

Trend analysis

Hi everybody,

I need to calculate the trend of a variable. I have this kind of data:

JAN       FEB        MAR       APR      MAY   JUN

100        80           90           120        110     70

I need to know what's the trend of the last six months. In Qlik, if it is positive I'll have a up arrow, if it's negative I have to rappresent a down arrow. So I don't have to rappresent a chart, only to know the function to calculate the trend.

Thank you very very much for your help!

1 Reply
simotrab
Creator III
Creator III

Hi Anna,

there is a function that could help you, the linest_m()

http://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/Scripting/StatisticalAggregati...

This function calculate the angular coefficient in a bivariate regression, that means that if the value is negative, the coefficient of the interpolate is negative, viceversa, it's positive (for not statistical people, "trend").

The problem is that your data are bivariate, but one is not a quantitative variable, but a qualitative one, the names of the months.

You ought transform the months in numbers, and calculate the coefficient between the two variables. Here the "new" data.

load*Inline

[month,value,value2

jan,100,1

feb,80,2

mar,90,3

apr,120,4

may,110,5

jun,70,6

];

Then you can calculate the linest_m(value, value2) and add any conditional symbol as up or down arrows.

Be aware that it could be tricky forcing a dimension as a measure.