Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for
Did you mean:
Creator II

## Count function

Hi Experts,

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.

1 Solution

Accepted Solutions

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)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
5 Replies

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.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable

try this in script:

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

MVP

May be like this?

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

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)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

Yes you are correct.

I will go with tresesco‌ solution.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Community Browser