Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everybody,
In a data cube we use there are duplicated records (same respondents correspond to different question properties)
I used the following expression:
avg({$<X.QID = {$(=only(X_LIST.QID))}, Y.QID = {$(=only(Y_LIST.QID))}, RESPONDENT = {">0"} >} Y.Answer) - original formula
The average works perfectly, but when I need to weight the data, I get the result multiplied by 4 (because of the duplicates)
This is the formula I need to modify:
Sum({$<X.QID = {$(=only(X_LIST.QID))}, Y.QID ={$(=only(Y_LIST.QID))}, %RESPONDENT = {">0"} >} Y.Answer*WEIGHT)/
Sum({$<X.QID = {$(=only(X_LIST.QID))}, Y.QID ={$(=only(Y_LIST.QID))}, %RESPONDENT = {">0"} >} RespondentCount*WEIGHT)
How can I set up DISTINCT RESPONDENT or just do not consider duplicates in the set analysis?
When I use Average function with weighting, I do not get the right results.
Thank you very much in advance!!!!!
Did you try:
Sum({$<X.QID = {$(=only(X_LIST.QID))}, Y.QID ={$(=only(Y_LIST.QID))}, %RESPONDENT = {">0"} >} distinct Y.Answer*WEIGHT)/
Sum({$<X.QID = {$(=only(X_LIST.QID))}, Y.QID ={$(=only(Y_LIST.QID))}, %RESPONDENT = {">0"} >} distinct RespondentCount*WEIGHT)
I did, but in this case I select only 1 possible Y.Answer which is a scale from 0 to 10, not a respondent.
Tne result is wrong, but thank you anyway.