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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to remove duplicates in a set analysis? Thanks!

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!!!!!

2 Replies
jvitantonio
Specialist III
Specialist III

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)

Not applicable
Author

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.