
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count of multiple columns with or condition in set analysis
Hi,
I am trying to get the count ID where fieldA and fieldB is not empty AND field1 is not empty OR field2 is not empty OR field3 is not empty with the below expression, but its not working:
=Count({$<fieldA =-{''},fieldB=-{''},field1 -={''}>+
<fieldA =-{''},fieldB =-{''},field2 -={''}>+
<fieldA =-{''},fieldB =-{''},field3 -={''}>} Distinct [ID] )
- Tags:
- qlikview_scripting
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Why don't you create a flag in the script for this
If( (Len(Trim(fieldA)) > 0 and Len(Trim(fieldB)) > 0 and Len(Trim(field1)) > 0) or
(Len(Trim(fieldA)) > 0 and Len(Trim(fieldB)) > 0 and Len(Trim(field2)) > 0) or
(Len(Trim(fieldA)) > 0 and Len(Trim(fieldB)) > 0 and Len(Trim(field3)) > 0), 1, 0) as Flag
and then this
Count(DISTINCT {<Flag = {1}>} ID)
or try this
=Count({$<fieldA = {"*"}, fieldB = {"*"}, field1 = {"*"}>+
<fieldA = {"*"}, fieldB = {"*"}, field2 = {"*"}>+
<fieldA = {"*"}, fieldB = {"*"}, field3 = {"*"}>} Distinct [ID] )

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is not feasible, as I have many conditions like this, around 20-30

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This one also is not working
=Count({$<fieldA = {"*"}, fieldB = {"*"}, field1 = {"*"}>+
<fieldA = {"*"}, fieldB = {"*"}, field2 = {"*"}>+
<fieldA = {"*"}, fieldB = {"*"}, field3 = {"*"}>} Distinct [ID] )


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be try like
<FieldA={'=Len(FieldA)>0'}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would you be able to provide a sample and explain as to what exactly are you hoping to get?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
=Count({$<fieldA =-{''},fieldB=-{''},field1 -={''}>+
<fieldA =-{''},fieldB =-{''},field2 =-{''}>+
<fieldA =-{''},fieldB =-{''},field3 =-{''}>} Distinct [ID] )

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sunny,
Because of security reasons I cant share the file, but the issue is not with comparing it to null as individually the output is correct but only when I am using OR condition the output is wrong.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Sasidhar, I tried this but issue is not comparing the field with null but in OR condition.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry Carlo its not working.

- « Previous Replies
-
- 1
- 2
- Next Replies »