Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

jjlyngle
New Contributor II

Indirect set analysis

I am trying to create a report showing only those Cust Keys where Last Month the Add Indicator = Y OR the Type Code = 123 AND where This Month the Add Indicator = N OR the Type Code <>123 OR the Status = C

Any help?

I tried this - and yes, it failed......

only({<[Account] = P({1<[Date] = {'$(vLastMonth)'}

,[Add Indicator] = {'Y'}

>})

+

P({1<[Date] = {'$(vLastMonth)'}

,[Type Code] = {'123'}

>})

+

P({1<[Date] = {'$(vMaxDate)'}

,[Add Indicator] = {'N'}

>})

+

P({1<[Date] = {'$(vMaxDate)'}

,[Type Code] <> {'123'}

+

P({1<[Date]={'$(vMaxDate)'

,[Status]={'C'}

>})

>}[Cust Key]

)

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Indirect set analysis

Hard to tell with no information about your model or expression context.

In addition, 'it failed' is not a good description of what you get compared to what you expected to get.

For now, I can't see how you've handled the AND part of your requirement, so maybe try using an intersection operator and few parenthesis:

only({<[Account] =

(

P({1<[Date] = {'$(vLastMonth)'}

,[Add Indicator] = {'Y'}

>})

+

P({1<[Date] = {'$(vLastMonth)'}

,[Type Code] = {'123'}

>})

)

*

(

P({1<[Date] = {'$(vMaxDate)'}

,[Add Indicator] = {'N'}

>})

+

P({1<[Date] = {'$(vMaxDate)'}

,[Type Code] <> {'123'}

+

P({1<[Date]={'$(vMaxDate)'

,[Status]={'C'}

>})

)

>}[Cust Key]

)

2 Replies
MVP
MVP

Re: Indirect set analysis

Hard to tell with no information about your model or expression context.

In addition, 'it failed' is not a good description of what you get compared to what you expected to get.

For now, I can't see how you've handled the AND part of your requirement, so maybe try using an intersection operator and few parenthesis:

only({<[Account] =

(

P({1<[Date] = {'$(vLastMonth)'}

,[Add Indicator] = {'Y'}

>})

+

P({1<[Date] = {'$(vLastMonth)'}

,[Type Code] = {'123'}

>})

)

*

(

P({1<[Date] = {'$(vMaxDate)'}

,[Add Indicator] = {'N'}

>})

+

P({1<[Date] = {'$(vMaxDate)'}

,[Type Code] <> {'123'}

+

P({1<[Date]={'$(vMaxDate)'

,[Status]={'C'}

>})

)

>}[Cust Key]

)

jjlyngle
New Contributor II

Re: Indirect set analysis

Thank you for the help, the

  • is what I needed!