Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

LOGICAL OR in QLIKVIEW

I have the following Scenario.

USER_ID, FIELD-A, FIELD-B, FIELD-C, FIELD-D

I am trying to count USER_ID if any of the FIELDS-A  to FIELD-D has more than 0.

How do I count?

Thank you

1 Solution

Accepted Solutions
Gysbert_Wassenaar

count({<[FIELD-A]={'>0'}>+<[FIELD-B]={'>0'}>+<[FIELD-C]={'>0'}+<[FIELD-D]={'>0'} USER_ID)


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

count({<[FIELD-A]={'>0'}>+<[FIELD-B]={'>0'}>+<[FIELD-C]={'>0'}+<[FIELD-D]={'>0'} USER_ID)


talk is cheap, supply exceeds demand
er_mohit
Master II
Master II

Try this

A:

load

USER_ID, FIELD-A, FIELD-B, FIELD-C, FIELD-D

from table;

No Concatenate

load

count(if(FIELD-A>0 and FIELD-B>0 and  FIELD-C>0 and  FIELD-D>0,USER_ID)) as User_Count,

USER_ID, FIELD-A, FIELD-B, FIELD-C, FIELD-D

resident A;

Group by USER_ID, FIELD-A, FIELD-B, FIELD-C, FIELD-D;

drop table A;