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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to find slopes of trendlines for multiple series in a straight table? Linest_m?

Hi,

I would like to compute the slope of linear trendlines of many series and keep in a straight table. 

For example, if I have 10 months of data for 3 cities, can I create a table that consists of 3 rows for the cities and a column that shows the different slopes for each of the linear trendlines.  I think I should use Linest_m but I get confused by the TOTAL and the AGGR function embedded in it. 

Can someone please help?  (See tables below)

Thanking in advance,

Anthony

Desired Results Table:

CitySlope
Albany31.29
Cleveland18.31
Jacksonville46.02

Raw Data Table:

MonthNoCitySalesSlope
1Albany2,31731.29
2Albany2,75131.29
3Albany2,34731.29
4Albany2,40531.29
5Albany2,58631.29
6Albany2,40731.29
7Albany2,56131.29
8Albany2,52631.29
9Albany2,68131.29
10Albany2,81431.29
1Cleveland1,84818.31
2Cleveland2,10818.31
3Cleveland1,80818.31
4Cleveland1,76718.31
5Cleveland1,88918.31
6Cleveland1,84118.31
7Cleveland2,03118.31
8Cleveland1,93318.31
9Cleveland2,00118.31
10Cleveland2,11518.31
1Jacksonville2,36246.02
2Jacksonville2,73446.02
3Jacksonville2,23946.02
4Jacksonville2,38746.02
5Jacksonville2,59446.02
6Jacksonville2,52946.02
7Jacksonville2,86546.02
8Jacksonville2,64646.02
9Jacksonville2,67446.02
10Jacksonville2,87446.02
1 Solution

Accepted Solutions
Not applicable
Author

Dear All,

I found the answer to my question when I discovered the following thread after I had posted:

http://community.qlik.com/message/72194#72194

John WItherspoon did an excellent job explaining the Linest_M and Aggr functions.

Thanks!

Anthony

View solution in original post

7 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Something like

=Linest_m(Aggr(Sum(Sales), City, MonthNo), MonthNo)

Hope that helps

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Dear All,

I found the answer to my question when I discovered the following thread after I had posted:

http://community.qlik.com/message/72194#72194

John WItherspoon did an excellent job explaining the Linest_M and Aggr functions.

Thanks!

Anthony

Not applicable
Author

Dear All,

I found the answer to my question when I discovered the following thread after I had posted:

http://community.qlik.com/message/72194#72194

John WItherspoon did an excellent job explaining the Linest_M and Aggr functions.

Thanks!

Anthony

Not applicable
Author

Dear All,

I found the answer to my question when I discovered the following thread after I had posted:

http://community.qlik.com/message/72194#72194

John WItherspoon did an excellent job explaining the Linest_M and Aggr functions.

Thanks!

Anthony

Not applicable
Author

Dear All,

I found the answer to my question when I discovered the following thread after I had posted:

         http://community.qlik.com/message/72194#72194

John WItherspoon did an excellent job explaining the Linest_M and Aggr functions.

Thanks!

Anthony

Not applicable
Author

Dear All,

I found the answer to my question when I discovered the following thread after I had posted:

         http://community.qlik.com/message/72194#72194

John WItherspoon did an excellent job explaining the Linest_M and Aggr functions.

Thanks!

Anthony

Not applicable
Author

Dear All,

I found the answer to my question when I discovered the following thread after I had posted:

         http://community.qlik.com/message/72194#72194

John WItherspoon did an excellent job explaining the Linest_M and Aggr functions.

Thanks!

Anthony