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: 
ketanvaria
Contributor III
Contributor III

Count Unpivot Table (Distinct does not give right results)

I have an original table with 3 records.

Original TableQuestion AQuestion B
1ExpertExpert
2BasicBasic
3ExpertNo Knowledge 

 

So A simple KPI count function gives me the answer 3 (which is correct!)

I have had to unpivot the table to do some more analysis 

UNPIVOT TABLE  
RecordQuestionSkill
1AExpert
2ABasic
3AExpert
4BExpert
5BBasic
6BNo Knowledge 

 

So A simple KPI count function gives me the answer 6 (which is incorrect!)

I tried DISTINCT COUNT function on Question but got the result 2 (which is incorrect!)

What function do I use to get the answer 3? I don't want to have 2 table so want to use the Unpivot table throughout. 

 

Labels (2)
1 Reply
jan_vandersypt
Partner - Contributor II
Partner - Contributor II

You'll have to include the recno from the original table in your unpivot table. I guess you have some kind of a participant_id, the person who filled in the two questions? You should use a distinct count on that field.

--
kind regards
Jan