Skip to main content
Announcements
Sept. 27, 10AM ET Do more with Qlik, Insight Advisor – our intelligent AI-assistant in Qlik Sense: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

Count function

Hi Experts,

Can any one please help me on below requirement.

I have to calculate  the count when Column A is not matching with Column B based on unique IDs.

Here for the XYZ ID Column A is not Matching with Column B. So i need to get the count as 1.

COUNT.png

Thanks in advance

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Rather, I would think much on this?


If(ColumnA <> ColumnB, 1,0) as Flag


Then, Count({<Flag = {1}>} ID)


Or direct forward

Count({<ColumnA = {"=ColumnA <> ColymnB"}>} ID)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

5 Replies
PrashantSangle

In straight table try like simple if with count()

count(if(ColumnA<>ColumnB,1,0))

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Anonymous
Not applicable

try this in script:

load
count(if(Hash128(product)<>Hash128(product1),Customer)) as newcustomercount
;
Load * inline [
Customer,product,product1
A,p1,p1
B,p2,p10
C,p3,p4
D,p5,p6
]
;

tresesco
MVP
MVP

May be like this?

Count({<ID={"=[Column A]<>[Column B]"}>}ID)

Anil_Babu_Samineni

Rather, I would think much on this?


If(ColumnA <> ColumnB, 1,0) as Flag


Then, Count({<Flag = {1}>} ID)


Or direct forward

Count({<ColumnA = {"=ColumnA <> ColymnB"}>} ID)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
PrashantSangle

Yes you are correct.

I will go with tresesco‌ solution.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.