Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Count matching values in 2 different fields

HI

Im fairly new to qlikview and im trying to do the following , in the below table there is 3 zeros in the picked column and 3 zeros in the BOH column, so there is 3 instances were picked  = 0 and BOH = 0.

how do i create an expression where i can get the value 3 returned ( this is the 3 instances were 0 = 0.)

pickedBOH

1

1
00
00
00
54

i believe in excel the countifs function can be used.

thanking you in advance

Lynn

8 Replies
Anil_Babu_Samineni

Are you expecting this?

Count({<picked = {'0'}, BOH={'0'}>} Measure)

OR

Count(If(picked=0 and BOH = 0,Measure))

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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)
Not applicable
Author

im trying to determine where ever picked = 0 and BOH = 0, how many instances of that is there.

sam_grounds
Contributor III
Contributor III

Hi Lynn,

This should do the trick. You just need to compare the two fields against each other to find matches...

=num(count(if(picked=BOH,[YourMainIdentifierField])),'#,##0')

If you're only matching the 0's, then this will suffice...

=num(count({$<picked={0},BOH={0}>}[YourMainIdentifierField])),'#,##0')


Sam

sathishbabu_s_g
Contributor III
Contributor III

Hi Lynn,

Just create a column like below. Let me know if it helps.

LOAD

Picked,

BOH,

if(Picked = BOH, 'TRUE', 'FALSE') as Match

INLINE [

    Picked, BOH

    1, 1

    0, 0

    0, 0

    0, 0

    5, 4

];

Anil_Babu_Samineni

May be?

Count({<picked = {'0'}, BOH={'0'}>} Instance) // Here, I haven't seen any Instance field in your data

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

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)
sam_grounds
Contributor III
Contributor III

=num(count({$<picked={0},BOH={0}>}picked)),'#,##0')

Kushal_Chawda

Please provide enough data to build the logic, here you need to find out instances , so what should be counted as instances, is there any Key field in your data?

sam_grounds
Contributor III
Contributor III

You could just count one of the fields mentioned as outlined in my example above.