Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
Hi Anna,
there is a function that could help you, the linest_m()
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.