Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

OR Statement within Set Analysis

What is the correct syntax of an OR statement of two different field conditions in set analysis?

Essentially what I want:

Num(Count(distinct {$<DateType = {'RequestedDate'}, Date = {'>=$(v30Days)'},REQUEST_STATUS_GENERIC={'Open'},REQUEST_ORIGINATION = {'Customer'}, REQUEST_SLA_RESPONSE_PASTDUE = {'N'} OR REQUEST_EST_SLA_COMPLETION_TIME  = {'<vCurrentDate)'}>} REQUEST_ID),'#,###')

1 Solution

Accepted Solutions
PrashantSangle

Hi,

You can try

Num(

Count(distinct {$<DateType = {'RequestedDate'}, Date = {'>=$(v30Days)'},REQUEST_STATUS_GENERIC={'Open'},REQUEST_ORIGINATION = {'Customer'}, REQUEST_SLA_RESPONSE_PASTDUE = {'N'} >

+

<DateType = {'RequestedDate'}, Date = {'>=$(v30Days)'},REQUEST_STATUS_GENERIC={'Open'},REQUEST_ORIGINATION = {'Customer'},REQUEST_EST_SLA_COMPLETION_TIME  = {'<vCurrentDate)'}> } REQUEST_ID),'#,###')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

6 Replies
settu_periasamy
Master III
Master III

Hi,

Try this

Num(Count(DISTINCT {$<DateType = {'RequestedDate'},

                      Date = {'>=$(v30Days)'},REQUEST_STATUS_GENERIC={'Open'},

                      REQUEST_ORIGINATION = {'Customer'},

                      REQUEST_SLA_RESPONSE_PASTDUE = {'N'} >} REQUEST_ID)

  +

  Count(DISTINCT {$<DateType = {'RequestedDate'},

                          Date = {'>=$(v30Days)'},REQUEST_STATUS_GENERIC={'Open'},

                          REQUEST_ORIGINATION = {'Customer'},

                REQUEST_EST_SLA_COMPLETION_TIME  = {'<vCurrentDate)'}>} REQUEST_ID)

  ,'#,###')

Not applicable
Author

Unfortunately that would cause duplicates if a request meets both criteria.

PrashantSangle

Hi,

You can try

Num(

Count(distinct {$<DateType = {'RequestedDate'}, Date = {'>=$(v30Days)'},REQUEST_STATUS_GENERIC={'Open'},REQUEST_ORIGINATION = {'Customer'}, REQUEST_SLA_RESPONSE_PASTDUE = {'N'} >

+

<DateType = {'RequestedDate'}, Date = {'>=$(v30Days)'},REQUEST_STATUS_GENERIC={'Open'},REQUEST_ORIGINATION = {'Customer'},REQUEST_EST_SLA_COMPLETION_TIME  = {'<vCurrentDate)'}> } REQUEST_ID),'#,###')

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

So if a request met both criteria, would the Distinct only allow for it to be counted once?

Also, is there no true syntax for an OR statement?

PrashantSangle

Have you tried above solution. In Set Analysis + works like OR Operator

Try it and let me know.

IF possible post your sample app.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

You are right, I had brain fart.

Thank you!