Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I am hoping that you could help me.... I am trying to achieve the below:
we have created a standard line chart showing the sum of sales over time, (with grouped dimensions to show Customer, product, etc.) and used the inbuilt function to show the trend lines. However, the user would like to be able to select something to show all negative trends (obviously this would change depending on the selectors) and potentially show a range of trends such as the dynamic buckets - all trends with -20% decline, 40%, 60% etc… I hope this is possible, but any help you could provide would be most appreciated!!
If you could provide an examples, or any assistance, I would be very grateful!!!
Kind regards,
Dayna
Just replace linest_m with linest_b.
aggr(linest_b(aggr(sum(Sales),Customer,Month),Month),Customer)
However, if you're creating a linear equation, this will only work if you have a dimension of customer, as it will generate a separate slope and Y-intercept for every Customer. I assume that's what you're after, but if not, you'd remove the outside aggr to get a single linear equation across all customers.
Hi John.
I tried this, but the number don't match.
In my app, I don't have any other dimension, just the Period.
Thank you very much again... for your help...
Regards
Julian
Sounds like this is the same as your question in the other thread, then, in which case I'll refer you to my answer and example in that thread. If you want to verify that the example in that thread is producing the correct linear equation, you can turn on the linear trendline for the first expression, and the two lines should overlap.
http://community.qlik.com/forums/t/24358.aspx
linest_m(total aggr(sum(Sales),Month),Month)*Month
+linest_b(total aggr(sum(Sales),Month),Month)
Hi John
I'll try to do this in my app whit your app as example.
One more time, thank you for your reply and help.
Regards
Julian
Dear John,
do you see any easy way to get the X and Y values of a specific trendline point?
My current idea is to have a reference line which intersects the trendline and have the coordinates displayed somewhere.
The reference line would be placed by a user input field or a slider.
Best regards
Fridtjof