Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

florian_kloster
New Contributor III

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

Re: Linest Function using aggr from different tables

Try this?

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

Or

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
florian_kloster
New Contributor III

Re: Linest Function using aggr from different tables

Hi and thanks for your thoughts!

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

Thanks,
Florian