Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to calculate the correlation between the answers of two questions.
So I made a variable to calculate the sum of one question. (OverallQuestion) :=Sum({1<question={'finalquestion'}>}answer)
The answer to the questions is allways numeric (or null)
However when I make an expression like =correl($(Overallquestio),Question) i don't get results.
Some questions were not answered, so there are null-values
Is it possible to use variables in the function Correl ?
Generally you could use variables for nearly each part from dimensions or expression - it's only a question from the syntax.
If you used the syntax "= AnyExpression" for a variable the variable will be global calculated without any relation to objects or dimensions. If you want use the variable as replace for a expression then without the equal-sign. Further the call from variables needed often a $-expansion like $(=variable), see also:
The Magic of Dollar Expansions
Therefore try something like this:
variable:
Sum({1<question={'finalquestion'}>}answer)
expression:
correl($(=Overallquestion),Question)
And by problems with NULL could be a rangecorrel() helpful.
- Marcus
For $(=Overallquestion) I get a result. But when I enter Correl($(=Overallquestion),$(=Overallquestion)) I don't get a result (only a '-'). Should be 1
Strange.. or am I missing something ?
Maybe there are any invalid values or NULL on the level from the aggregation. Try to handle it with rangecorrel() or $(=alt(Overallquestion, DefaultValue)).
- Marcus
Your variable "OverallQuestion" contains a basic aggregation function. You can't use this in Correl unless you use TOTAL.
See if this fixes your error.