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: 
Not applicable

Problem displaying linest_M in a straight table

 

I am attempting to display multiple trend lines on a straight table through the use of the linest_M function.  Currently, the correct slope calculation appears only after I have selected one “product-code”.

 

Here is my expression:

 

=LINEST_M(aggr(((sum(extMargin)/sum(extPrice))*100),[product-code],MonthYear),(aggr(rank(-MonthYear),MonthYear)-1))

 

current multiple selection output.  (three values are '-' and one is 0.366  which is incorrect)

chart.PNG

  current single selection output. (linest_M value is correct @ -2.17)

chart2.PNG

how do I display all linest_M values for each selected "Product-code" at the same time??

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe

=LINEST_M(aggr(((sum(extMargin)/sum(extPrice))*100),[product-code],MonthYear),(aggr(rank(-MonthYear),[product-code], MonthYear)-1))

View solution in original post

2 Replies
MarcoWedel

please post sample app

thanks

regards

Marco

swuehl
MVP
MVP

Maybe

=LINEST_M(aggr(((sum(extMargin)/sum(extPrice))*100),[product-code],MonthYear),(aggr(rank(-MonthYear),[product-code], MonthYear)-1))