Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate the change % of a curve

If there was a trend line on the charts how would I be able to determine the improvement or degradation over a specific time period (here it is 52 weeks).

I have a line chart that shows me my safety calculation over 52 weeks (each week I have a new file).

the chart works great and that is not the problem.  The problem is I need to create a straight table that has my center (that is easy) my safety calculation (got that), the slope (cant get this to work), and then the rank by the slope (not sure how to do that after I can get the slope to work)

For the slope I tried to follow something I have seen online but all I get is dashes.  Any help as to what I need to do to get this working and then how I would get a rank bast on the slope. 1 being the highest number?

I tried this for slope:

LINEST_M(aggr(nodistinct sum(Safety), FileDate, Center), FileDate)


To get the safety I have this and it works.

Avg( {<FileDate = >} ([Total Miles] / (Speeding + Brake + Seatbelt + Accel)))


How do I get the slope to show up in my chart? and then how do I rank by the slope?

Safety.png

12 Replies
sunny_talwar

See if this adding TOTAL helps

LINEST_M(TOTAL aggr(nodistinct sum(Safety), FileDate, Center), FileDate)

Anonymous
Not applicable
Author

Still not getting anything.

sunny_talwar

What is safety here? an expression or field?

juliedecoene
Partner - Contributor III
Partner - Contributor III

What if you replace Safety by {<FileDate = >} ([Total Miles] / (Speeding + Brake + Seatbelt + Accel)) inside your Sum() function (without the Avg) ?

Anonymous
Not applicable
Author

expression

round(Avg( {<FileDate = >} ([Total Miles] / (Speeding + Brake + Seatbelt + Accel))))

FileDate, Total Miles, Speeding, Brake, Seatbelt, Accel are all dimensions.

Anonymous
Not applicable
Author

Still getting the same thing.

sunny_talwar

How about this

LINEST_M(TOTAL Aggr(NODISTINCT Avg({<FileDate = >} ([Total Miles] / (Speeding + Brake + Seatbelt + Accel))), FileDate, Center), FileDate)

Anonymous
Not applicable
Author

Still nothing

sunny_talwar

Do you mind sharing a sample?