Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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]

)

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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]

)

View solution in original post

2 Replies
swuehl
MVP
MVP

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]

)

Anonymous
Not applicable
Author

Thank you for the help, the

  • is what I needed!