Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Showing Correlation Coefficient in Chart

Hi Folks,

Is it possible to create a chart like shows in the attachment?

In the image i have two fields for "Poly GPA" & "CIA GPA" and on that basis I have to calculate Correlation Coefficient (R2) which is shown in line.

Regards,

Yojas

7 Replies
tresesco
MVP
MVP

Have a look at Correl() function.

Not applicable
Author

Hi,

You can use correl() function. From Qlikview Help:

correl ([{set_expression}] [ total [<fld {,fld}>] ] x-expression, y-expression )

returns the aggregated correlation coefficient for a series of coordinates represented by paired numbers in x-expression and y-expression iterated over the chart dimension(s). Text values, null values and missing values in any or both pieces of a data-pair will result in the entire data-pair to be disregarded. See also the rangecorrel function.

X-expression and y-expression must not contain aggregation functions, unless these inner aggregations contain the total qualifier. For more advanced nested aggregations, please use the aggr function in combination with calculated dimensions.

This function has the same limitations for nested aggregation as the avg function. The correl function supports sets and the total qualifier in the same way as the avgfunction.

Examples:

correl( Payments, Dates )     

Not applicable
Author

Hi Shyamal,

Thanks for the explanation..

Currently I created 1 sample and in that I am using

"Correl(Aggr(sum([CIA GPA]),[CIA GPA]),Aggr(sum([Poly GPA]),[Poly GPA]))" this expression and getting output on the basis of that. But still i am getting Y not 'y2' .

PFA for my sample.

Kindly suggest if it is the right way..

Regards,

Yojas

Not applicable
Author

Might be you need to use "Total" qualifier. Have you tried with Total?

Not applicable
Author

Hi Shyamal,

I am getting your point..

Can you provide it in the Sample??

Regards,

Yojas

Not applicable
Author

Hi, yojas, im wondering if u still want an anwser for this problem, in that case take a look to the QVW that i made and tell me if that is what u wanted from the begining.

regards.

Rina
Contributor
Contributor

Hi,

Is Correl() function base on Pearson's ? Or something esle ?

Regards,

Rina