Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
alenb
Partner - Contributor III
Partner - Contributor III

Simple logical expression in set expression

In my set expression I am trying to achieve a relatively simple thing. 

sum({$ < Month= {'07'}, Year = {'2020'}, Type = {WHLS} OR Type = {CUST}> } Units)

 

The problem is in this logical OR, so I would like a set that is of certain year, certain month, but Type can be either WHLS or CUST. I know the following is possible but seems like too much repetition.

 

sum({$ < Month= {'07'}, Year = {'2020'}, Type = {WHLS} Type = {CUST}> + < Month= {'07'}, Year = {'2020'}, Type = {WHLS} Type = {CUST}> } Units)

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Hi Alenb

Try this expression :

 

sum({$ < Month= {'07'}, Year = {'2020'}, Type = {'WHLS' , 'CUST' }> } Units)

 

View solution in original post

4 Replies
Vegar
MVP
MVP

Hi Alenb

Try this expression :

 

sum({$ < Month= {'07'}, Year = {'2020'}, Type = {'WHLS' , 'CUST' }> } Units)

 

tm_burgers
Creator III
Creator III

sum({$ < Month= {'07'}, Year = {'2020'}, Type = {'WHLS','CUST'}> } Units)

Anil_Babu_Samineni

@Vegar I think this will work as "AND" operator.

@alenb Rather try this way?

sum({$ < Month= {'07'}, Year = {'2020'}, Type = {'WHLS'}>+<Type = {'CUST'}> } Units)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Vegar
MVP
MVP

@Anil_Babu_Samineni I believe my earlier suggestion is correct,  the list of values in a set modifier works as a list of selections in a field.The expression below will sum the units of your current selections, but where the Type 'WHLS' and 'CUST' is selected. This will return the sum of units where Type is  'WHLS' OR 'CUST' . 

sum({$ <Type = {'WHLS' , 'CUST' }> } Units)