<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240126#M850956</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4951"&gt;Set Analysis: syntaxes, examples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;From Help&lt;/H1&gt;&lt;H1 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Analysis&lt;/H1&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Sets can be used in aggregation functions. Aggregation functions normally aggregate over the set of possible records defined by the current selection. But an alternative set of records can be defined by a set expression. Hence, a set is conceptually similar to a selection.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;A set expression always begins and ends with curly brackets when used, e.g. {BM01}.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Identifiers&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;There is one constant that can be used to denote a record set; 1. It represents the full set of all the records in the application.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The $ sign represents the records of the current selection. The set expression {$} is thus the equivalent of not stating a set expression. {1-$} is all the more interesting as it defines the inverse of the current selection, i.e. everything that the current selection excludes.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Selections from the Back/Forward stack can be used as set identifiers, by use of the dollar symbol: $1 represents the previous selection, i.e. equivalent to pressing the Back button. Similarly, $_1 represents one step forward, i.e. equivalent to pressing the Forward button. Any unsigned integer can be used in the Back and Forward notations, i.e. $0 represents the current selection..&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Finally, bookmarks can be used as set identifiers. Note that only server and document bookmarks can be used as set identifiers. Either the bookmark ID or the bookmark name can be used, e.g. BM01 or MyBookmark. Only the selection part of a bookmark is used. The values are not included. It is thus not possible to use input fields in bookmarks for set analysis.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$} Sales )&lt;BR /&gt;returns sales for the current selection, i.e. the same as sum(Sales).&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$1} Sales )&lt;BR /&gt;returns sales for the previous selection.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$_2} Sales )&lt;BR /&gt;returns sales for the 2nd next selection, i.e. two steps forward. Only relevant if you just made two Back operations.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {1} Sales )&lt;BR /&gt;returns total sales within the application, disregarding the selection but not the dimension. If used in a chart with e.g. Products as dimension, each product will get a different value.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {1} Total Sales )&lt;BR /&gt;returns total sales within the application, disregarding both selection and dimension. I.e. the same as sum(All Sales).&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {BM01} Sales )&lt;BR /&gt;returns sales for the bookmark BM01.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {MyBookMark} Sales )&lt;BR /&gt;returns sales for the bookmark MyBookMark.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum({Server\BM01} Sales)&lt;BR /&gt;returns the sales for the server bookmark BM01.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum({Document\MyBookmark}Sales)&lt;BR /&gt;returns the sales for the document bookmark MyBookmark.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Operators&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Several set operators that can be used in set expressions exist. All set operators use sets as operands, as described above, and return a set as result.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;+ Union. This binary operation returns a set consisting of the records that belong to any of the two set operands.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;- Exclusion. This binary operation returns a set of the records that belong to the first but not the other of the two set operands. Also, when used as a unary operator, it returns the complement set.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;* Intersection. This binary operation returns a set consisting of the records that belong to both of the two set operands.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;/ Symmetric difference (XOR). This binary operation returns a set consisting of the records that belong to either, but not both of the two set operands.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The order of precedence is 1) Unary minus (complement), 2) Intersection and Symmetric difference, and 3) Union and Exclusion. Within a group, the expression is evaluated from left to right. Alternative orders can be defined by standard brackets, which may be necessary since the set operators do not commute, e.g. A+(B-C) is different from (A+B)-C which in turn is different from (A-C)+B.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {1-$} Sales )&lt;BR /&gt;returns sales for everything excluded by the current selection.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$*BM01} Sales )&lt;BR /&gt;returns sales for the intersection between the current selection and bookmark BM01.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {-($+BM01)} Sales )&lt;BR /&gt;returns sales excluded by current selection and bookmark BM01.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Note&lt;BR /&gt;The use of set operators in combination with basic aggregation expressions involving fields from multiple QlikView tables may cause unpredictable results and should be avoided. E.g. if Quantity and Price are fields from different tables, then the expression sum({$*BM01}Quantity*Price) should be avoided.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;A set can be modified by an additional or a changed selection. Such a modification can be written in the set expression. The modifier consists of one or several field names, each followed by a selection that should be made on the field, all enclosed by &amp;lt; and &amp;gt;. E.g. &amp;lt;Year={2007,+2008},Region={US}&amp;gt;. Field names and field values can be quoted as usual, e.g. &amp;lt;[Sales Region]={'West coast', 'South America'}&amp;gt;.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;There are several ways to define the selection: A simple case is a selection based on the selected values of another field, e.g. &amp;lt;OrderDate = DeliveryDate&amp;gt;. This modifier will take the selected values from DeliveryDate and apply those as a selection on OrderDate. If there are many distinct values - more than a couple of hundred - then this operation is CPU intense and should be avoided.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The most common case, however, is a selection based on a field value list enclosed in curly brackets, the values separated by commas, e.g. &amp;lt;Year = {2007, 2008}&amp;gt;. The curly brackets here define an element set, where the elements can be either field values or searches of field values. A search is always defined by the use of double quotes, e.g. &amp;lt;Ingredient = {"*Garlic*"}&amp;gt; will select all ingredients including the string 'garlic'. Searches are case-insensitive and are made also over excluded values.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Empty element sets, either explicitly e.g. &amp;lt;Product = {}&amp;gt; or implicitly e.g. &amp;lt;Product = {"Perpetuum Mobile"}&amp;gt; (a search with no hits) mean no product, i.e. they will result in a set of records that are not associated with any product. Note that this set cannot be achieved through usual selections, unless a selection is made in another field, e.g. TransactionID.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Finally, for fields in and-mode, there is also the possibility of forced exclusion. If you want to force exclusion of specific field values, you will need to use "~" in front of the field name.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;A set modifier can be used on a set identifier or on its own. It cannot be used on a set expression. When used on a set identifier, the modifier must be written immediately after the set identifier, e.g. {$&amp;lt;Year = {2007, 2008}&amp;gt;}. When used on its own, it is interpreted as a modification of the current selection.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {1&amp;lt;Region= {US} &amp;gt;} Sales )&lt;BR /&gt;returns the sales for region US disregarding the current selection.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Region = &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection, but with the selection in "Region" removed.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {&amp;lt;Region = &amp;gt;} Sales )&lt;BR /&gt;returns the same as the example immediately above. When the set to modify is omitted, $ is assumed.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Note!&lt;BR /&gt;The syntax in the two previous examples is interpreted as "no selections" in "Region", i.e. all regions given other selections will be possible. It is not equivalent to the syntax &amp;lt;Region = {}&amp;gt; (or any other text on the right side of the equal sign implicitly resulting in an empty element set) which is interpreted as no region.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {2000}, Region = {US, SE, DE, UK, FR}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but with new selections both in "Year" and in "Region".&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;~Ingredient = {"*garlic*"}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but with a forced exclusion of all Ingredients containing the string 'garlic'.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {"2*"}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but with all years beginning with the digit "2", i.e. most likely year 2000 and onwards, selected in the field "Year".&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {"2*","198*"}&amp;gt;} Sales )&lt;BR /&gt;as above, but now also the 1980:s are included in the selection.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {"&amp;gt;1978&amp;lt;2004"}&amp;gt;} Sales )&lt;BR /&gt;as above, but now with a numeric search so that an arbitrary range can be specified.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers with set operators&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The selection within a field can be defined using set operators as described above, working on different element sets. E.g. the modifier &amp;lt;Year = {"20*", 1997} - {2000}&amp;gt; will select all years beginning with "20" in addition to "1997", except for "2000".&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Product = Product + {OurProduct1} - {OurProduct2} &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection, but with the product "OurProduct1" added to the list of selected products and "OurProduct2" removed from the list of selected products.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = Year + ({"20*",1997} - {2000}) &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection but with additional selections in the field "Year": 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.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = (Year + {"20*",1997}) - {2000} &amp;gt;} Sales )&lt;BR /&gt;returns almost the same as above, but here 2000 will be excluded, also if it initially is included in the current selection. The example shows the importance of sometimes using brackets to define an order of precedence.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {"*"} - {2000}, Product = {"*bearing*"} &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection but with a new selection in "Year": all years except 2000; and only for products containing the string 'bearing'.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers using assignments with implicit set operators&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The above 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, e.g. you may want a modifier &amp;lt;Year = Year + {2007, 2008}&amp;gt;. A short and equivalent way to write this is &amp;lt;Year += {2007, 2008}&amp;gt;, i.e. the assignment operator implicitly defines a union. Also implicit intersections, exclusions and symmetric differences can be defined using "*=", "-=" and "/=".&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Product += {OurProduct1, OurProduct2} &amp;gt;} Sales )&lt;BR /&gt;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.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year += {"20*",1997} - {2000} &amp;gt;} Sales )&lt;BR /&gt;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 &amp;lt;Year=Year + ({"20*",1997}-{2000})&amp;gt;&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Product *= {OurProduct1} &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection, but only for the intersection of currently selected products and the product "OurProduct1".&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers with dollar-sign expansions&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Variables and other dollar-sign expansions can be used in set expressions.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {$(#vLastYear)}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for the previous year in relation to current selection. Here, a variable vLastYear containing the relevant year is used in a dollar-sign expansion.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {$(#=Only(Year)-1)}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for the previous year in relation to current selection. Here, a dollar-sign expansion is used to calculate previous year.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers with advanced searches&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Advanced searches using wildcards and aggregations can be used to define sets.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$-1&amp;lt;Product = {"*Internal*", "*Domestic*"}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, excluding transactions pertaining to products with the string 'Internal' or 'Domestic' in the product name.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = {"=Sum({1&amp;lt;Year = {2007}&amp;gt;} Sales ) &amp;gt; 1000000"}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but with a new selection in the "Customer" field: only customers who during 2007 had a total sales of more than 1000000.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers with implicit field value definitions&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;In the above examples, all field values have been explicitly defined or defined through searches. There is however an additional way to define a set of field values by the use of a nested set definition.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;In such cases, the element functions P() and E() must be used, representing the element set of possible values and the excluded values of a field, respectively. Inside the brackets, it is possible to specify one set expression and one field, e.g. P({1} Customer). These functions cannot be used in other expressions:&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = P({1&amp;lt;Product={'Shoe'}&amp;gt;} Customer)&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but only those customers that ever have bought the product 'Shoe'. The element function P( ) here returns a list of possible customers; those that are implied by the selection 'Shoe' in the field Product.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = P({1&amp;lt;Product={'Shoe'}&amp;gt;})&amp;gt;} Sales )&lt;BR /&gt;same as above. If the field in the element function is omitted, the function will return the possible values of the field specified in the outer assignment.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = P({1&amp;lt;Product={'Shoe'}&amp;gt;} Supplier)&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but only those customers that ever have supplied the product 'Shoe'. The element function P( ) here returns a list of possible suppliers; those that are implied by the selection 'Shoe' in the field Product. The list of suppliers is then used as a selection in the field Customer.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = E({1&amp;lt;Product={'Shoe'}&amp;gt;})&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but only those customers that never bought the product 'Shoe'. The element function E( ) here returns the list of excluded customers; those that are excluded by the selection 'Shoe' in the field Product.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Syntax for Sets&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Hence, the full syntax (not including the optional use of standard brackets to define precedence) is&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_expression ::= { set_entity { set_operator set_entity } }&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_entity ::= set_identifier [ set_modifier ]&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_identifier ::= 1 | $ | $N | $_N | bookmark_id | bookmark_name&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_operator ::= + | - | * | /&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_modifier ::= &amp;lt; field_selection {, field_selection } &amp;gt;&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;field_selection ::= field_name [ = | += | ¬-= | *= | /= ] element_set_expression&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element_set_expression ::= element_set { set_operator element_set }&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element_set ::= [ field_name ] | { element_list } | element_function&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element_list ::= element { , element }&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element_function ::= ( P | E ) ( [ set_expression ] [ field_name ] )&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element ::= field_value | " search_mask "&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Mar 2017 07:54:20 GMT</pubDate>
    <dc:creator>avinashelite</dc:creator>
    <dc:date>2017-03-07T07:54:20Z</dc:date>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240124#M850954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is the set analysis in qlikview? why, where and how we used it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240124#M850954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240125#M850955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/" style="font-size: 10pt;" title="https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/"&gt;https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-4951" style="font-size: 10pt;" title="https://community.qlik.com/docs/DOC-4951"&gt;https://community.qlik.com/docs/DOC-4951&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/SetAnalysis/set-analysis-expressions.htm" title="https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/SetAnalysis/set-analysis-expressions.htm"&gt;https://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/SetAnalysis/set-analysis-expressions.…&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 07:52:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240125#M850955</guid>
      <dc:creator>muthukumar77</dc:creator>
      <dc:date>2017-03-07T07:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240126#M850956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4951"&gt;Set Analysis: syntaxes, examples&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;From Help&lt;/H1&gt;&lt;H1 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Analysis&lt;/H1&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Sets can be used in aggregation functions. Aggregation functions normally aggregate over the set of possible records defined by the current selection. But an alternative set of records can be defined by a set expression. Hence, a set is conceptually similar to a selection.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;A set expression always begins and ends with curly brackets when used, e.g. {BM01}.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Identifiers&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;There is one constant that can be used to denote a record set; 1. It represents the full set of all the records in the application.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The $ sign represents the records of the current selection. The set expression {$} is thus the equivalent of not stating a set expression. {1-$} is all the more interesting as it defines the inverse of the current selection, i.e. everything that the current selection excludes.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Selections from the Back/Forward stack can be used as set identifiers, by use of the dollar symbol: $1 represents the previous selection, i.e. equivalent to pressing the Back button. Similarly, $_1 represents one step forward, i.e. equivalent to pressing the Forward button. Any unsigned integer can be used in the Back and Forward notations, i.e. $0 represents the current selection..&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Finally, bookmarks can be used as set identifiers. Note that only server and document bookmarks can be used as set identifiers. Either the bookmark ID or the bookmark name can be used, e.g. BM01 or MyBookmark. Only the selection part of a bookmark is used. The values are not included. It is thus not possible to use input fields in bookmarks for set analysis.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$} Sales )&lt;BR /&gt;returns sales for the current selection, i.e. the same as sum(Sales).&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$1} Sales )&lt;BR /&gt;returns sales for the previous selection.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$_2} Sales )&lt;BR /&gt;returns sales for the 2nd next selection, i.e. two steps forward. Only relevant if you just made two Back operations.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {1} Sales )&lt;BR /&gt;returns total sales within the application, disregarding the selection but not the dimension. If used in a chart with e.g. Products as dimension, each product will get a different value.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {1} Total Sales )&lt;BR /&gt;returns total sales within the application, disregarding both selection and dimension. I.e. the same as sum(All Sales).&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {BM01} Sales )&lt;BR /&gt;returns sales for the bookmark BM01.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {MyBookMark} Sales )&lt;BR /&gt;returns sales for the bookmark MyBookMark.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum({Server\BM01} Sales)&lt;BR /&gt;returns the sales for the server bookmark BM01.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum({Document\MyBookmark}Sales)&lt;BR /&gt;returns the sales for the document bookmark MyBookmark.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Operators&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Several set operators that can be used in set expressions exist. All set operators use sets as operands, as described above, and return a set as result.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;+ Union. This binary operation returns a set consisting of the records that belong to any of the two set operands.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;- Exclusion. This binary operation returns a set of the records that belong to the first but not the other of the two set operands. Also, when used as a unary operator, it returns the complement set.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;* Intersection. This binary operation returns a set consisting of the records that belong to both of the two set operands.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;/ Symmetric difference (XOR). This binary operation returns a set consisting of the records that belong to either, but not both of the two set operands.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The order of precedence is 1) Unary minus (complement), 2) Intersection and Symmetric difference, and 3) Union and Exclusion. Within a group, the expression is evaluated from left to right. Alternative orders can be defined by standard brackets, which may be necessary since the set operators do not commute, e.g. A+(B-C) is different from (A+B)-C which in turn is different from (A-C)+B.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {1-$} Sales )&lt;BR /&gt;returns sales for everything excluded by the current selection.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$*BM01} Sales )&lt;BR /&gt;returns sales for the intersection between the current selection and bookmark BM01.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {-($+BM01)} Sales )&lt;BR /&gt;returns sales excluded by current selection and bookmark BM01.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Note&lt;BR /&gt;The use of set operators in combination with basic aggregation expressions involving fields from multiple QlikView tables may cause unpredictable results and should be avoided. E.g. if Quantity and Price are fields from different tables, then the expression sum({$*BM01}Quantity*Price) should be avoided.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;A set can be modified by an additional or a changed selection. Such a modification can be written in the set expression. The modifier consists of one or several field names, each followed by a selection that should be made on the field, all enclosed by &amp;lt; and &amp;gt;. E.g. &amp;lt;Year={2007,+2008},Region={US}&amp;gt;. Field names and field values can be quoted as usual, e.g. &amp;lt;[Sales Region]={'West coast', 'South America'}&amp;gt;.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;There are several ways to define the selection: A simple case is a selection based on the selected values of another field, e.g. &amp;lt;OrderDate = DeliveryDate&amp;gt;. This modifier will take the selected values from DeliveryDate and apply those as a selection on OrderDate. If there are many distinct values - more than a couple of hundred - then this operation is CPU intense and should be avoided.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The most common case, however, is a selection based on a field value list enclosed in curly brackets, the values separated by commas, e.g. &amp;lt;Year = {2007, 2008}&amp;gt;. The curly brackets here define an element set, where the elements can be either field values or searches of field values. A search is always defined by the use of double quotes, e.g. &amp;lt;Ingredient = {"*Garlic*"}&amp;gt; will select all ingredients including the string 'garlic'. Searches are case-insensitive and are made also over excluded values.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Empty element sets, either explicitly e.g. &amp;lt;Product = {}&amp;gt; or implicitly e.g. &amp;lt;Product = {"Perpetuum Mobile"}&amp;gt; (a search with no hits) mean no product, i.e. they will result in a set of records that are not associated with any product. Note that this set cannot be achieved through usual selections, unless a selection is made in another field, e.g. TransactionID.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Finally, for fields in and-mode, there is also the possibility of forced exclusion. If you want to force exclusion of specific field values, you will need to use "~" in front of the field name.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;A set modifier can be used on a set identifier or on its own. It cannot be used on a set expression. When used on a set identifier, the modifier must be written immediately after the set identifier, e.g. {$&amp;lt;Year = {2007, 2008}&amp;gt;}. When used on its own, it is interpreted as a modification of the current selection.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {1&amp;lt;Region= {US} &amp;gt;} Sales )&lt;BR /&gt;returns the sales for region US disregarding the current selection.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Region = &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection, but with the selection in "Region" removed.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {&amp;lt;Region = &amp;gt;} Sales )&lt;BR /&gt;returns the same as the example immediately above. When the set to modify is omitted, $ is assumed.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Note!&lt;BR /&gt;The syntax in the two previous examples is interpreted as "no selections" in "Region", i.e. all regions given other selections will be possible. It is not equivalent to the syntax &amp;lt;Region = {}&amp;gt; (or any other text on the right side of the equal sign implicitly resulting in an empty element set) which is interpreted as no region.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {2000}, Region = {US, SE, DE, UK, FR}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but with new selections both in "Year" and in "Region".&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;~Ingredient = {"*garlic*"}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but with a forced exclusion of all Ingredients containing the string 'garlic'.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {"2*"}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but with all years beginning with the digit "2", i.e. most likely year 2000 and onwards, selected in the field "Year".&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {"2*","198*"}&amp;gt;} Sales )&lt;BR /&gt;as above, but now also the 1980:s are included in the selection.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {"&amp;gt;1978&amp;lt;2004"}&amp;gt;} Sales )&lt;BR /&gt;as above, but now with a numeric search so that an arbitrary range can be specified.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers with set operators&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The selection within a field can be defined using set operators as described above, working on different element sets. E.g. the modifier &amp;lt;Year = {"20*", 1997} - {2000}&amp;gt; will select all years beginning with "20" in addition to "1997", except for "2000".&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Product = Product + {OurProduct1} - {OurProduct2} &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection, but with the product "OurProduct1" added to the list of selected products and "OurProduct2" removed from the list of selected products.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = Year + ({"20*",1997} - {2000}) &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection but with additional selections in the field "Year": 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.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = (Year + {"20*",1997}) - {2000} &amp;gt;} Sales )&lt;BR /&gt;returns almost the same as above, but here 2000 will be excluded, also if it initially is included in the current selection. The example shows the importance of sometimes using brackets to define an order of precedence.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {"*"} - {2000}, Product = {"*bearing*"} &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection but with a new selection in "Year": all years except 2000; and only for products containing the string 'bearing'.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers using assignments with implicit set operators&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;The above 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, e.g. you may want a modifier &amp;lt;Year = Year + {2007, 2008}&amp;gt;. A short and equivalent way to write this is &amp;lt;Year += {2007, 2008}&amp;gt;, i.e. the assignment operator implicitly defines a union. Also implicit intersections, exclusions and symmetric differences can be defined using "*=", "-=" and "/=".&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Product += {OurProduct1, OurProduct2} &amp;gt;} Sales )&lt;BR /&gt;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.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year += {"20*",1997} - {2000} &amp;gt;} Sales )&lt;BR /&gt;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 &amp;lt;Year=Year + ({"20*",1997}-{2000})&amp;gt;&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Product *= {OurProduct1} &amp;gt;} Sales )&lt;BR /&gt;returns the sales for the current selection, but only for the intersection of currently selected products and the product "OurProduct1".&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers with dollar-sign expansions&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Variables and other dollar-sign expansions can be used in set expressions.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {$(#vLastYear)}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for the previous year in relation to current selection. Here, a variable vLastYear containing the relevant year is used in a dollar-sign expansion.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Year = {$(#=Only(Year)-1)}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for the previous year in relation to current selection. Here, a dollar-sign expansion is used to calculate previous year.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers with advanced searches&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Advanced searches using wildcards and aggregations can be used to define sets.&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$-1&amp;lt;Product = {"*Internal*", "*Domestic*"}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, excluding transactions pertaining to products with the string 'Internal' or 'Domestic' in the product name.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = {"=Sum({1&amp;lt;Year = {2007}&amp;gt;} Sales ) &amp;gt; 1000000"}&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but with a new selection in the "Customer" field: only customers who during 2007 had a total sales of more than 1000000.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Set Modifiers with implicit field value definitions&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;In the above examples, all field values have been explicitly defined or defined through searches. There is however an additional way to define a set of field values by the use of a nested set definition.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;In such cases, the element functions P() and E() must be used, representing the element set of possible values and the excluded values of a field, respectively. Inside the brackets, it is possible to specify one set expression and one field, e.g. P({1} Customer). These functions cannot be used in other expressions:&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Examples:&lt;/H2&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = P({1&amp;lt;Product={'Shoe'}&amp;gt;} Customer)&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but only those customers that ever have bought the product 'Shoe'. The element function P( ) here returns a list of possible customers; those that are implied by the selection 'Shoe' in the field Product.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = P({1&amp;lt;Product={'Shoe'}&amp;gt;})&amp;gt;} Sales )&lt;BR /&gt;same as above. If the field in the element function is omitted, the function will return the possible values of the field specified in the outer assignment.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = P({1&amp;lt;Product={'Shoe'}&amp;gt;} Supplier)&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but only those customers that ever have supplied the product 'Shoe'. The element function P( ) here returns a list of possible suppliers; those that are implied by the selection 'Shoe' in the field Product. The list of suppliers is then used as a selection in the field Customer.&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;sum( {$&amp;lt;Customer = E({1&amp;lt;Product={'Shoe'}&amp;gt;})&amp;gt;} Sales )&lt;BR /&gt;returns the sales for current selection, but only those customers that never bought the product 'Shoe'. The element function E( ) here returns the list of excluded customers; those that are excluded by the selection 'Shoe' in the field Product.&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Syntax for Sets&lt;/H3&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Hence, the full syntax (not including the optional use of standard brackets to define precedence) is&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_expression ::= { set_entity { set_operator set_entity } }&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_entity ::= set_identifier [ set_modifier ]&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_identifier ::= 1 | $ | $N | $_N | bookmark_id | bookmark_name&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_operator ::= + | - | * | /&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;set_modifier ::= &amp;lt; field_selection {, field_selection } &amp;gt;&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;field_selection ::= field_name [ = | += | ¬-= | *= | /= ] element_set_expression&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element_set_expression ::= element_set { set_operator element_set }&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element_set ::= [ field_name ] | { element_list } | element_function&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element_list ::= element { , element }&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element_function ::= ( P | E ) ( [ set_expression ] [ field_name ] )&lt;/P&gt;&lt;P style="margin: 0 0 0 40px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;element ::= field_value | " search_mask "&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 07:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240126#M850956</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2017-03-07T07:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240127#M850957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first link is very helpful to me..thank you so much..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 08:11:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240127#M850957</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-07T08:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240128#M850958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you avinash..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 08:11:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/1240128#M850958</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-07T08:11:47Z</dc:date>
    </item>
  </channel>
</rss>

