Qlikview set analysis is an ace in the Qlikview’s stack of cards for a developer. Qlikview’s associative data model works well with your current selections. But there are times when you want to create a set or a group of information independent of your current selection. In other words, a data set that has no influence of your current selections. A year over year or a month over month sales comparison is a handy example for you to use Qlikview set analysis for.
Like those fun lego games, you can start with all data in your application and then add, remove or change data to create another set that you want.
I admit that the syntax of the set analysis in qlikview is bit intimidating for a beginner, but it’s not as daunting as it looks once you master the concept.
Let’s start with the basics first.
The very word set analysis ought to remind you of a guy named John Venn. We all have learned Venn diagram in our school days. And, you will revisit this age-old theory again as we learn set analysis in Qlikview.
With that said, set analysis provides a method to create a set based on another set. And, by now it must be obvious to you that it is used in aggregation function.
So, let’s look at the anatomy of a set analysis function in Qlikview, shall we?
It has three major categories: Identifiers, Operators and Modifiers
It starts and ends with a curly bracket: {}
Example:
1. Set analysis begins and ends with { }
2. Modifier begins and ends with < >
3. Operator: =
4. Identifier is not shown but it is $ which is the default state in Qlikview.
For those of you who know SQL, set analysis is akin to a SELECT…. GROUP BY delivered in a concise expression. Armed with this basic knowledge, now you can add many more forms of identifiers, operators and modifiers to create a complex aggregation that otherwise requires many IF statements.
Do you want to master QlikView Set Analysis? Enroll in my Udemy course
For a limited time, I am offering the course just for $29.
https://www.udemy.com/mastering-qlikview-set-analysis/?couponCode=LQSA29
Let’s look at each category and its various options:
1. IDENTIFIERS:
Identifier defines the state of the set.
$ is the default state, meaning the current selection for a given sheet.
1 ignores the current selection and considers all the values in the data set.
Bookmark10 state defined by a stored bookmark. If you are new, please review this article to learn more about book marks.
Now, the fun begins…
You can subtract one state from another. For example,
1 – $ Selects all values from the data set but the current selection.
1- Bookmark10 Selects all values from the data set but those defined by a given bookmark.
MODIFIERS:
Identifier is like a SELECT keyword and Modifier is like a WHERE clause or a filter in your SQL select statement. It works on the selected data set — based on your identifier — to add, remove or to modify existing selections.
Modifiers start with < and end with >. In this example, the returned data set gets modified to filter Year with 2005 and 2006 values. Thus, the resulting data set contains only data for those 2 years.
If you want to do a year vs year analysis, modifier allows you to select data set for the previous year. Like identifier, modifier can make otherwise complicated programming a simple task. For instance, if you want to ignore certain field from your data set, you can simply add a modifier with <Field=>.
OPERATORS:
Operators are like executors of the Qlikview set analysis. Operators somewhat control behavior of modifier statements. They are like a method of an object as they allow interactions between two different data sets in a single expression.
If nowhere else, John Venn’s diagram lives it legacy when you depict how operators work in Qlikview. Remember that we learned union, exclusion, intersection and symmetric difference in our school days when we learned about the Venn diagram.
Example: sum({$ + Year20052006} TotalDue)
Four basic operators:
Set analysis syntax is intimidating for most beginners, but Stefan has created an excellent set analysis wizard that makes this daunting task easy to deal with.
As you can see, Qlikview set analysis is a powerful way for you to create dynamic data sets mainly for comparison analysis. We have just made our feet wet in the ocean of possibilities with this introduction.
In the next Qlikview tutorial, we will try to swim together with some advance techniques using dollar sign expansion. Till then, so long…
Do you want to master QlikView Set Analysis? I have an online course with over 60 lectures to teach you from basics of Set Analysis to advanced topics.
Set Analysis is one of the most powerful features and my goal is to help you master Set Analysis so that you can instantly start using it in your next QlikView or Qlik Sense application.
For a limited time, I am offering the course just for $29.
https://www.udemy.com/mastering-qlikview-set-analysis/?couponCode=LQSA29
photo by: knitvana
Ken 6:41 am on June 8, 2013 Permalink
Shilpan,
Once a person understand basics like ” $ = selected and 1 = ALL” rest you made it so simple to understand with multiple examples which are the Fundamentals of Set Analysis. this Article and video will be very insightful to any newcomers to have a command over Qlikview because Set Analysis is a Key Factor for any Qlikview Professional, Thank You and appreciate you sharing your knowledge to other Professionals !
Chandraish Sinha 6:40 pm on June 9, 2013 Permalink
I find your articles very informative and a fun way to learn.I am always interested in learning and sharing BI. I worked in multiple tools like QlikView and Tableau and found both of them equally interesting. Please visit my blog http://www.LearnAllBi.com where i have shared some insights on both QlikView and Tableau.
Standa 8:17 am on August 22, 2013 Permalink
Hi Shilpan,
this post is really nice. I still try to understand main differencies in SET analysis. Is there a possibility to ignore a filter and to define a condition calculate based on certain groups?
My approach is to set Customer and Variant as a condition group, and {} as ignore filter.
I made my post over here, maybe you as a profi will solve it.
http://community.qlikview.com/thread/88892
Nobody is able to answer it, I would wonder if there isn’t any solution.
Sophia 9:35 pm on October 15, 2013 Permalink
Shilpan , thank you for sharing Qlikview fundamental of set analysis , it was easy to understand this Article for a beginners in Qlikview! Please try to share more post in your blog”s ?
bishruta 10:18 am on December 4, 2013 Permalink
hi shilpan,
Can you please tell me how to get an aggregate from the first record upto the current selection?as in if i have records from 1990 and each time i select the year it should aggregate upto that year starting from 1990.
QlikView Your Business: A Book Review « Learn Qlikview 2:55 am on November 2, 2015 Permalink
[…] Qlikview Set Analysis: Basics […]
QlikView Dynamic Filters « Learn Qlikview 2:43 am on July 1, 2016 Permalink
[…] Qlikview Set Analysis: Basics […]