Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
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),'#,###')

Tags (3)
1 Solution

Accepted Solutions

Re: OR Statement within Set Analysis

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

Regards,
Prashant Sangle
6 Replies

Re: OR Statement within Set Analysis

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

Re: OR Statement within Set Analysis

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

Re: OR Statement within Set Analysis

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

Regards,
Prashant Sangle
Not applicable

Re: OR Statement within Set Analysis

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?

Re: OR Statement within Set Analysis

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

Regards,
Prashant Sangle
Not applicable

Re: OR Statement within Set Analysis

You are right, I had brain fart.

Thank you!