Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
maxime66
Creator
Creator

Count distinct row

Hi Qlikers,

Is there a simple expression to calculate distinct values for many columns ?

I'm looking for the result in "Distinct phone" row

Thanks for your time and help.

max.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

count(distinct pick(match($Field,'Phone1','Phone2','Phone3'),[Phone1],[Phone2],[Phone3]))

count(distinct pick(valueloop(1,3),Phone1,Phone2,Phone3))

View solution in original post

14 Replies
MK_QSL
MVP
MVP

What is the result you are expecting?

maxime66
Creator
Creator
Author

Hi Manish,

looking for result in "Distinct phone" row

MK_QSL
MVP
MVP

Like this?

maxime66
Creator
Creator
Author

Result is good ,

but i would like not to touch my script ...

sunny_talwar

Non script way would be very complicated with if statements to check if the two columns have same value.

maxime66
Creator
Creator
Author

We have to ask Qlikview to create a special count

=countvalueline(distinct (Row1,Row2 ...) )

maxime66
Creator
Creator
Author

i found :

rangecount(expr1 [ , expr2, ... exprN ])


it's pretty much what i am looking for

but it seems that it doesn't work with  Distinct

sunny_talwar

Exactly that's what the issue is.... For distinct you will need some if statements

maxime66
Creator
Creator
Author

Thanks anyway Sunny,

Let's Go for traditional IF(IF(IF(IF(IF 

have a good weekend