Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
salto
Specialist II
Specialist II

OR Condition in Set Analysis

Hello all,

I would like to count the records in a table, all those that meets this condition: fiels PostingDate OR field OpeningDate OR field ClosingDate is in a date range (between StartDate and EndDate)

So I have tried with:

count ({<PostingDate = {"<=$(StartDate)>=$(EndDate)"} >} ReturnID) +
count ({<OpeningDate = {"<=$(StartDate)>=$(EndDate)"} >} ReturnID) +
count ({<ClosingDate = {"<=$(StartDate)>=$(EndDate)"} >} ReturnID)

But it can count a record more than once, because the same record can meet the three conditions so it would be counted more than once.

If I write it this way:

count ({<PostingDate = {"<=$(StartDate)>=$(EndDate)"},OpeningDate = {"<=$(StartDate)>=$(EndDate)"} ,ClosingDate = {"<=$(StartDate)>=$(EndDate)"} >} ReturnID)

It will only count the records that meet the three conditions.

So, how could I write it so it works like an OR?

Many thanks in advance.

1 Solution

Accepted Solutions
martin59
Specialist II
Specialist II

Hello,

You can try this :

count ({<PostingDate = {"<=$(StartDate)>=$(EndDate)"}>+<OpeningDate = {"<=$(StartDate)>=$(EndDate)"} >+<ClosingDate = {"<=$(StartDate)>=$(EndDate)"} >} ReturnID)


Martin

View solution in original post

1 Reply
martin59
Specialist II
Specialist II

Hello,

You can try this :

count ({<PostingDate = {"<=$(StartDate)>=$(EndDate)"}>+<OpeningDate = {"<=$(StartDate)>=$(EndDate)"} >+<ClosingDate = {"<=$(StartDate)>=$(EndDate)"} >} ReturnID)


Martin