Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Do More with Qlik - for Beginners and Beyond, Topic: Qlik Replicate on January 21, 2PM EST. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Conditional Count expression

Hi,

I need your help please, how to write this correctly (I get wrong results):

=if([ Quality Assurance Claims Major LOB ]='A&H'

    OR [ Quality Assurance Claims Major LOB ]='Life'

    OR [ Quality Assurance Claims Major LOB ]='Property'

    OR [ Quality Assurance Claims Major LOB ]='Personal Lines',

    if([ Life of Claim ]>'36',  count([Claim Number])))

Must be a way to do it with conditional count (like below), but I don't know how to write it with 'OR':

=count({<[ Quality Assurance Claims Major LOB ]={'A&H'}

     OR [ Quality Assurance Claims Major LOB ]={'Life'}

     OR [ Quality Assurance Claims Major LOB ]={'Property'}

     OR [ Quality Assurance Claims Major LOB ]={'Personal Lines'} ,

     [ Life of Claim ]={'>36'}>}  [Claim Number])



1 Solution

Accepted Solutions
Contributor III
Contributor III

I found the solution:

   

=count({<[ Quality Assurance Claims Major LOB ]={'A&H'}, [ Life of Claim ]={'>36'}>}  [Claim Number])

    + count({<[ Quality Assurance Claims Major LOB ]={'Life'}, [ Life of Claim ]={'>36'}>}  [Claim Number])

    + count({<[ Quality Assurance Claims Major LOB ]={'Property'}, [ Life of Claim ]={'>36'}>}  [Claim Number])

    + count({<[ Quality Assurance Claims Major LOB ]={'Personal Lines'}, [ Life of Claim ]={'>36'}>}  [Claim Number])

  

And it works well

View solution in original post

7 Replies
Partner
Partner

what's the error you get?

Contributor III
Contributor III

I don't get an error, just wrong results.

Creator III
Creator III

Try this -

if(Wildmatch([Quality Assurance Claims Major LOB],'A&H','Life','Property','Personal Lines')

   and

   [ Life of Claim ]>'36'

,

   count([Claim Number]))

Contributor III
Contributor III

No results at all

Creator III
Creator III

can you post sample app ?

Contributor III
Contributor III

I found the solution:

   

=count({<[ Quality Assurance Claims Major LOB ]={'A&H'}, [ Life of Claim ]={'>36'}>}  [Claim Number])

    + count({<[ Quality Assurance Claims Major LOB ]={'Life'}, [ Life of Claim ]={'>36'}>}  [Claim Number])

    + count({<[ Quality Assurance Claims Major LOB ]={'Property'}, [ Life of Claim ]={'>36'}>}  [Claim Number])

    + count({<[ Quality Assurance Claims Major LOB ]={'Personal Lines'}, [ Life of Claim ]={'>36'}>}  [Claim Number])

  

And it works well

View solution in original post

you don' t need to split your expressions, just use one as it will be a lot more efficient than one you have at the moment

:

=count({<[ Quality Assurance Claims Major LOB ]={'A&H','Life','Property','Personal Lines'}, [ Life of Claim ]={'>36'}>}  [Claim Number])

EDIT: btw. i would use "" (double quotes" for your {">36"} as per HIC suggestion here:

A Primer on Set Analysis

cheers

Lech

---------------------------------------------

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

cheers Lech, 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 to the problem.