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

OR condition in set analysis

Hi All,

How we can write OR condition in set analysis.

Sum({$<[Distribution Channel Desc]={'A','B','C'} or ([Distribution Channel Desc] = {'D'} and customerno = {'1','2','3'})>} Sales)

Thanks

10 Replies
MK_QSL
MVP
MVP

SUM({$<[Distribution Channel Desc]={'A','B','C'}>*<[Distribution Channel Desc] = {'D'},customerno = {'1','2','3'} >}Sales)

Anonymous
Not applicable
Author

Try:

Sum({<[Distribution Channel Desc]={'A','B','C'}>+

         <[Distribution Channel Desc] = {'D'} , customerno = {'1','2','3'})>}         Sales)


Marc.

Not applicable
Author

what is the important of * here

simondachstr
Luminary Alumni
Luminary Alumni

* is an intersection that returns a set consisting of the records that belong to both operands (typical AND)

I believe a Union + would be more appropriate in this case.

SUM({$<[Distribution Channel Desc]={'A','B','C'}>+<[Distribution Channel Desc] = {'D'},customerno = {'1','2','3'} >}Sales)

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi,

Try below expression

SUM({$<[Distribution Channel Desc]={'A','B','C'}>+<[Distribution Channel Desc] = {'D'},customerno = {'1','2','3'} >}Sales)

ashfaq_haseeb
Champion III
Champion III

+ for Union * For Intersection

Go with this

Sum({<[Distribution Channel Desc]={'A','B','C'}>+

         <[Distribution Channel Desc] = {'D'} , customerno = {'1','2','3'})>}         Sales)


Check the attached document for more details



Regards

ASHFAQ

Kushal_Chawda

Try

SUM({$<[Distribution Channel Desc]={'A','B','C'}>+<[Distribution Channel Desc] = {'D'},customerno = {'1','2','3'} >}Sales)

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi

Try this

Sum({$<GIDRDDNullFlag = {'0'},[Business Segment] = {'Power Components','Power Equipment'},

[Suspension Flag - MM]={'#'},Pole={'NA'},[Item Category]={'*'} -{'ZSPK','ZSK1'},newDueIndicator={'1.OVD'},

[PSI Code]={'*'} - {'S11'},[Sold To No]={'*'} - {'9950016'},[Distribution Channel Desc]={'Distribution','Other','Direct'} > +

<GIDRDDNullFlag = {'0'},[Business Segment] = {'Power Components','Power Equipment'}, 

[Suspension Flag - MM]={'#'},Pole={'NA'},[Item Category]={'*'} -{'ZSPK','ZSK1'},newDueIndicator={'1.OVD'},

[PSI Code]={'*'} - {'S11'},[Sold To No]={'*'} - {'9950016'}, [Distribution Channel Desc] = {'Intercompany'},[Sold To No] = {'9465653','9465654','9465655','9465716','9465718','9465720'}>}

} sales)

rubenmarin

Hi, maybe using different sum is easier:

Sum({$<GIDRDDNullFlag = {'0'},[Business Segment] = {'Power Components','Power Equipment'},

[Suspension Flag - MM]={'#'},Pole={'NA'},[Item Category]={'*'} -{'ZSPK','ZSK1'},newDueIndicator={'1.OVD'},

[PSI Code]={'*'} - {'S11'},[Sold To No]={'*'} - {'9950016'},[Distribution Channel Desc]={'Distribution','Other','Direct'}>} sales)

+  Sum({$<GIDRDDNullFlag = {'0'},[Business Segment] = {'Power Components','Power Equipment'},

[Suspension Flag - MM]={'#'},Pole={'NA'},[Item Category]={'*'} -{'ZSPK','ZSK1'},newDueIndicator={'1.OVD'},

[PSI Code]={'*'} - {'S11'},[Sold To No]={'9465653','9465654','9465655','9465716','9465718','9465720'}, [Distribution Channel Desc] = {'Intercompany'}>} sales)