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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
florian_kloster
Creator
Creator

Linest Function using aggr from different tables

Hi everyone,

I have a quick question - unfortunately, I didn't find any solutions on that on the internet. 😞
Is it possible to run a linest function using two aggr functions from different tables?

Here the syntaxt to import test data:

ORDERS:
LOAD * inline [
Jahr|Orders
2012|5874
2013|6924
2014|7442
2015|7834
2016|9463
2017|9222
] (delimiter is '|');


OPPORTUNITIES:
noconcatenate LOAD * inline [
Jahr_Opportunities|Opportunities
2012|6085
2013|6223
2014|6633
2015|6677
2016|7512
2017|7333
] (delimiter is '|');

And here the linest function, I want to run:
linest_r2(aggr(sum(Opportunities), Year_Opportunities), aggr(sum(Orders), Year_Orders))


I want to analyse how good the opportunities can be predicted by the number of orders. 
Does anybody knows if this is possible? Unfortunately, I don't and can't combine those tables on my original database.

Thanks,
Florian

2 Replies
Anil_Babu_Samineni

Try this?

linest_r2(sum(Opportunities), sum(Orders))

Or

linest_r2(Sum(Aggr(sum(Opportunities), Year_Opportunities)), Sum(Aggr(sum(Orders), Year_Orders)))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
florian_kloster
Creator
Creator
Author

Hi and thanks for your thoughts!

Unfortunately, this didn't work. Nested aggregations are not accepted.

Thanks,
Florian