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: 
Not applicable

using IF AND OR statements in Set Analysis

Hi

I am trying to figure out a set statement for the following rule

IF [Created Date] <= current select, AND [Close Date] > current select, OR [Order Status] -= 'Cancelled', 'Rejected', sum sales, 0

the end goal is to get a statement that sums up all open orders on any given day.

I don't even know if this is the best way to achieve this but due to the nature of open orders constantly changing I need to be able to have a progressive view on it.

thank you

2 Replies
Not applicable
Author

Try something like this:

Sum({<[Created Date]={"<=$(vCurrentSelect)"},[Close Date]={">=$(vCurrentSelect)"}>+<[Order Status-={'Cancelled','Rejected'}>}Sales)

swuehl
MVP
MVP

Hm, maybe like

= sum({<[Created Date] = {"<=$(=max(Date))"},[Close Date] = {">$(=max(Date))"}, [Order Status] -= {'Cancelled','Rejected'}>} Sales)

if Date is your date field to select from. I also assumed a AND [Order status] above given your textual description (all open orders on any given date). If there is only one OPEN status, you could use [Order Status] = {'Open'} instead above part.

Regards,

Stefan

P.S: You probably need to clear some fields also, like Date, more Date fields?

= sum({<[Created Date] = {"<=$(=max(Date))"},[Close Date] = {">$(=max(Date))"}, [Order Status] -= {'Cancelled','Rejected'}, Date=  >} Sales)