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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
dafnis14
Specialist
Specialist

Set Analysis - exclude range

Hi,

Any ideas about how to write the expression so that it will include the values not in the the current defined dates range?

I'm working in version 10, if it matters.

SuppReturns.ConfDate={">=$(vMinReturnDate)<=$(vMaxReturnDate)"}


Thanks!

1 Solution

Accepted Solutions
Not applicable

I like to avoid the proposed -= because it causes those nasty red lines and removes the benefits of syntax checker for the rest of the (sometimes long) expression.

You can combine sets in set analysis. One set is the one you define between {} after the field name. In this case we could do the union of sets {"<=$(vMinReturnDate)"} and {">=$(vMaxReturnDate)"}by using the +, so like this:

SuppReturns.ConfDate = {"<=$(vMinReturnDate)"} + {">=$(vMaxReturnDate)"}.

To get the range between, you actually used syntax I wasn't familiar with (but can be found from the help as well, it seems). I would have used * to get the intersection of the sets, like this:

SuppReturns.ConfDate = {">=$(vMinReturnDate)"} * {"<=$(vMaxReturnDate)"}

I hope these help!

Best regards,

Henry

View solution in original post

7 Replies
Not applicable

Try                

SuppReturns.ConfDate-={">=$(vMinReturnDate)<=$(vMaxReturnDate)"}



ashfaq_haseeb
Champion III
Champion III

Hi

if you are trying to calculate everything except current selection then Use

sum({1 - $}{<your expresion>} Sales)

It will return you inverse of current selection.

Attached document might help you

Regards

ASHFAQ

ashwanin
Specialist
Specialist

Try -= option

dafnis14
Specialist
Specialist
Author

Hi,

When i tried it, it gave an indication of a syntax error (red line).

I guess i can ignore it...

tresesco
MVP
MVP

Yes, you can ignore it. That's a qv parser error, otherwise syntax works fine.

Not applicable

I like to avoid the proposed -= because it causes those nasty red lines and removes the benefits of syntax checker for the rest of the (sometimes long) expression.

You can combine sets in set analysis. One set is the one you define between {} after the field name. In this case we could do the union of sets {"<=$(vMinReturnDate)"} and {">=$(vMaxReturnDate)"}by using the +, so like this:

SuppReturns.ConfDate = {"<=$(vMinReturnDate)"} + {">=$(vMaxReturnDate)"}.

To get the range between, you actually used syntax I wasn't familiar with (but can be found from the help as well, it seems). I would have used * to get the intersection of the sets, like this:

SuppReturns.ConfDate = {">=$(vMinReturnDate)"} * {"<=$(vMaxReturnDate)"}

I hope these help!

Best regards,

Henry

dafnis14
Specialist
Specialist
Author

Hi Henry,

Thanks for the very bright explanation.

I definitely agree with your recommendation.

Dafnis