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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Kirsten
Creator II
Creator II

Two conditions in one expression

I want to have two conditions in one expression, exclude the quarters as well as one value within markets, though below expression returns an error. What is going wrong?

Max({$<[Period]-={'2020 Q3','2020 Q2','2020 Q1', '2020 Q4', '2019 Q3', '2019 Q2', '2019 Q1'} and {$<[Market]-={'ALL MARKETS'}>} [FirstTimeRight])

 This one works

Max({$<[Period]-={'2020 Q3','2020 Q2','2020 Q1', '2020 Q4', '2019 Q3', '2019 Q2', '2019 Q1'}>} [FirstTimeRight])
2 Solutions

Accepted Solutions
marcus_sommer

Change it to:

Max({$<[Period]-={'2020 Q3','2020 Q2','2020 Q1', '2020 Q4', '2019 Q3', '2019 Q2', '2019 Q1'}, [Market]-={'ALL MARKETS'}>} [FirstTimeRight])


- Marcus

View solution in original post

marcus_sommer

Not using -= which excludes the listed values else just = maybe so:

Max({$<[Period]-={'2020 Q3','2020 Q2','2020 Q1', '2020 Q4', '2019 Q3', '2019 Q2', '2019 Q1'}, [Market]={'North America'}>} [FirstTimeRight])


- Marcus

View solution in original post

5 Replies
marcus_sommer

Change it to:

Max({$<[Period]-={'2020 Q3','2020 Q2','2020 Q1', '2020 Q4', '2019 Q3', '2019 Q2', '2019 Q1'}, [Market]-={'ALL MARKETS'}>} [FirstTimeRight])


- Marcus

Kirsten
Creator II
Creator II
Author

Ah thanks I see here it doesn't work with an AND statement

Kirsten
Creator II
Creator II
Author

@marcus_sommer  what is the expression when you want to select only one item to the list, and not remove the item. E.g. I only want to have a table with North America selected

 

marcus_sommer

Not using -= which excludes the listed values else just = maybe so:

Max({$<[Period]-={'2020 Q3','2020 Q2','2020 Q1', '2020 Q4', '2019 Q3', '2019 Q2', '2019 Q1'}, [Market]={'North America'}>} [FirstTimeRight])


- Marcus

Kirsten
Creator II
Creator II
Author

@marcus_sommer  yes that works thanks. The solution is very straightforward I was working with a plus (+) sign instead of minus (-) which didn't work