Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
PARK_JY
Contributor III
Contributor III

count if

hi,

I want to use countif function in sheet.

ex) count({<1st_field={>=2nd_field}>} 1st_field)

but it is not working.

How shiuld I modify the function?

thank you~

Labels (1)
  • QMC

2 Replies
BrunPierre
Partner - Master
Partner - Master

Count({$<1st_field={">=2nd_field"}>} 1st_field)

vinieme12
Champion III
Champion III

Set Analysis evaluates once per chart, and this requirement seems like matching values for each row!

 

1) Your best option is to create an actual flag field in your table during data load, example

 

,if(1st_field>=2nd_field,1,0) as  flag_

 

then use this field in your expression as

count({<flag_={1}>} 1st_field)

 

2) If you cannot create a field, use the below expression, but this could have significant performance impact

 

count({<ID={"=1st_field>=2nd_field"}>} 1st_field)

Where ID is a field that identifies each row uniquely

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.