QlikWorld 2020 Global Conference. Join us to discover how to get the most from your data. Act fast. Register now and save.

Set modifiers using assignments with implicit set operators

This notation defines new selections, disregarding the current selection in the field. However, if you want to base your selection on the current selection in the field and add field values, for example you may want a modifier <Year = Year + {2007, 2008}>. A short and equivalent way to write this is <Year += {2007, 2008}>, i.e. the assignment operator implicitly defines a union. Also implicit intersections, exclusions and symmetric differences can be defined using “*=”, “–=” and “/=”.

Examples and results:  

Examples Results
sum( {$<Product += {OurProduct1, OurProduct2} >} Sales )

Returns the sales for the current selection, but using an implicit union to add the products 'OurProduct1' and 'OurProduct2' to the list of selected products.

sum( {$<Year += {“20*”,1997} – {2000} >} Sales )

Returns the sales for the current selection but using an implicit union to add a number of years in the selection: 1997 and all that begin with “20” – however, not 2000.

Note that if 2000 is included in the current selection, it will still be included after the modification. Same as <Year=Year + ({“20*”,1997}–{2000})>.

sum( {$<Product *= {OurProduct1} >} Sales )

Returns the sales for the current selection, but only for the intersection of currently selected products and the product OurProduct1.

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?