7 February 2022 Qlik Set Identifiers Share this message Every Friday at Bitmetric we’re posting a new Qlik certification practice question to our LinkedIn company page. Last Friday we asked the following Qlik Business Analyst certification practice question about Set Analysis and Qlik Set Identifiers: There was a little catch to this question, which fooled exactly no one 😉 The correct answer is C: 65% Even though the Business Analyst selected the year 2022, that selection is ignored because the expression uses the 1 Set Identifier in the Set Analysis statement (or Set Expression). In fact, when using 1 as your Set Identifier, all selections are ignored. This means the expression is calculated for the entire data set. In our question, the result is that we have to take not only Feb 2022 into account, but also Feb 2021. From the table we can get the values for Sales (250 + 250 = 500) and Cost of Goods Sold (50 + 125 = 175). Plugging these values into the expression gets us (500 – 175) / 500 = 0.65, or 65%. Qlik Set Identifiers As mentioned above, the 1 used in the Set Expression is called a Set Identifier. You can think of the Set Identifier as the ‘starting point’ for the data that is included in your Set Expression. This data set can be further modified using a Set Modifier. For example using the <[Month]={‘Feb’}> modifier from the question. This sets the selection in the Month field to Feb. We’ll cover Set Modifiers another time though. Common Set Identifiers Besides 1, there are a few other common Set Identifiers: $ refers to the current user selection in the default state (i.e. not an Alternate State). If you don’t specify a Set Identifier, Qlik assumes $ by default. There’s a catch though, more on that later. $1 refers to the previous user selection in the default state, as if you pressed the Back button. $2 refers to 2 selections ago, $3 refers to 3 selections ago, etc. $_1 refers to the next user selection in the default state, as if you pressed the Forward button. $_2 refers to 2 selections forward, $3 refers to 3 selections forward, and so on. This identifier, and the previous one, typically see very little use in our projects as we find that users typically don’t want to compare current to previous selections. Rather, they want to make comparisons between multiple independent selections, which we’ll cover another time. Bookmark, you can use either the Title or the ID of a bookmark to refer to the selection stored inside it. Alternate State, you can use the Name of an Alternate State to refer to the selection within the state. Fun aside, Qlik will (sensibly) not let you create an Alternate State named $, but will let you create states named 1, $1 or with the same name as a bookmark title. This can lead to strange behavior as the clip below shows. When creating an Alternate State named 1, Qlik still interprets the 1 identifier as referencing the entire data set. However, when creating states named $1 or My Bookmark (which has the same name as a bookmark in the app) these identifiers now reference the Alternate States $1 and My Bookmark, and not the previous selection or the selection stored in the bookmark. Best to not mix up Set Identifiers and Alternate State names 😉 Leaving out $ assumes the current user selection As mentioned above, when you don’t specify a Set Identifier, Qlik assumes the current user selections. Many developers take this to mean that $ and no identifier are identical. Seeing an opportunity for laziness… er, efficiency, some may opt to just leave out $ when they want to refer to the current user selections. The catch is when you leave out the Set Identifier, Qlik assumes the current user selections for the inherited state. When placing an expression without a Set Identifier in an object that is in an Alternate State, Qlik will use the current user selections in that state, rather than the default state. The clip below illustrates this. Is this a bad thing, to be avoided at all cost? No, definitely not, but it’s good to be aware of the difference. Leaving out a Set Identifier can even be very convenient if you want to use a Master Measure containing Set Analysis across objects that are in different Alternate States. That’s it for this question! See you next Friday? More from the Bitmetric team Take your Qlik skills to the next level! Since 2013, the Masters Summit for Qlik is the premier advanced training for Qlik. Join us in Vienna and take your Qlik skills to the next level. Join the team! Enjoying these challenges? We have many more, and we’ll even pay you to solve them 😉 Check out our job opening. Friday Qlik Test Prep Set Analysis Solution How can we help? Barry has over 20 years experience as a Data & Analytics architect, developer, trainer and author. He will gladly help you with any questions you may have. Call us Mail us 25 April 2024 Over 3000 Qlik Sense servers still vulnerable to Cactus ransomware In November of last year we reported on how two critical vulnerabilities in Qlik Sense Enterprise for Windows were exploited in the Cactus ransomware campaign. As of today, over 3000 vulnerable Qlik Sense servers remain connected to the Internet. New Release Qlik Vulnerability 29 March 2024 Dealing with missing and late arriving values with OtherSymbol and other solutions Learn effective strategies for handling missing or late-arriving dimension values in Qlik with our expert guide. Discover how to use OtherSymbol, WHERE NOT EXISTS, and other solutions to deal with early-arriving facts Data Model Friday Qlik Test Prep Qlik Solution 22 March 2024 Picking the right color palette for your visualization Discover how to choose the perfect color palette for your data visualizations with our expert guide. Learn about single, categorical, sequential, and diverging color palettes to enhance your charts and graphs. Ideal for data analysts and visualizers. Friday Qlik Test Prep Qlik SenseTheme Visualization
25 April 2024 Over 3000 Qlik Sense servers still vulnerable to Cactus ransomware In November of last year we reported on how two critical vulnerabilities in Qlik Sense Enterprise for Windows were exploited in the Cactus ransomware campaign. As of today, over 3000 vulnerable Qlik Sense servers remain connected to the Internet. New Release Qlik Vulnerability
29 March 2024 Dealing with missing and late arriving values with OtherSymbol and other solutions Learn effective strategies for handling missing or late-arriving dimension values in Qlik with our expert guide. Discover how to use OtherSymbol, WHERE NOT EXISTS, and other solutions to deal with early-arriving facts Data Model Friday Qlik Test Prep Qlik Solution
22 March 2024 Picking the right color palette for your visualization Discover how to choose the perfect color palette for your data visualizations with our expert guide. Learn about single, categorical, sequential, and diverging color palettes to enhance your charts and graphs. Ideal for data analysts and visualizers. Friday Qlik Test Prep Qlik SenseTheme Visualization