# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for
Did you mean:
Highlighted
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
Highlighted
MVP

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

Highlighted
Specialist

Try:

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

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

Marc.

Highlighted
Not applicable

what is the important of * here

Highlighted
Luminary

* 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)

Highlighted
Partner

Hi,

Try below expression

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

Highlighted

+ 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

Highlighted
MVP

Try

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

Highlighted
Partner

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)

Highlighted
MVP

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)