You are on page 1of 6

The Magic of Set Analysis – Syntax and Examples « iQlik – Everything ...

http://iqlik.wordpress.com/2010/09/11/the-magic-of-set-analysis-synta...

iQlik – Everything QlikView.

Home About Contact

The Magic of Set Analysis – Syntax and Examples
September 11, 2010

Syntax & Examples
In this new Post of The Series, I will go over the details for creating a correct Set Expression. Also, I will provide some useful examples for you to get your Hands On right away. Follow these steps to build up your set expression and use the correct syntax: 1. First of all, you need to define what you want your expression to return. A good method to get it right would be to answer the following questions first: What field will I use in my expression? (For example: ‘Sales’, containing the sales amount for every invoice.) How will I aggregate the field? (It can be using Sum, Count, Avg, etc.) What explicit selections do I need in my expression? Here you define a Field and its value(s). (For example: I want ONLY the ‘South’ Region. Another example would be to only include values associated with certain Year.) Do I need to exclude/ignore some selections or values? 2. After you’ve answered the questions, you can go on to compse the expression. If you want to Sum the Sales amount, you would start with something like: Sum(Sales) 3. Then, whe need to add the Set portion of the expression.: This portion goes just after the first parenthesis, before the Field Name. The Set Expression will be enclosed in curly brackets: {set expression}. After the first curly bracket we add either a dollar sign (which means the record set will be based on the current selections) or a number 1 (meaning we will use the full record set of all the records in the application). We will use the dollar sign to illustrate, since it is the most common, so you will now have {$}. Important to note is that the dollar sign can be ommited and the set expression will not be affected. It is good practice, however, to use it. After the Dollar Sign, we define the fields that will play in our set expressions. All of these field-value definitions will be encolsed in less-than and grater-than symbols (< >). The syntax is FieldName = {FieldValue}. If FieldValue is a literal or text, you should enclose it in single quotes. If you want to use a search string as the FieldValue, enclose it in double quotes. Here are some examples: {$<Region = {‘South’}>} will result in a record set taking the current selections ($) where the Field Region has a value of ‘South’. {$<Year = {2010}>} will give return a record set based on current selections ($) where the Year is 2010 EVEN if you select something else in the field Year.

1 of 6

2011-09-22 00:32

] Part II of The Series. Syntax.. I will continue with the series to cover some more of it.] 2 of 6 2011-09-22 00:32 . you can create calculations to use them as Field Values: Year = {$(=Max(Year))} It is just as if you would use a variable (described above).] The Magic of Set Analysis – Syntax and Examples [.] Reply 2. 4. use Field = {“$(MySearchVariable)”} 6. The Magic of Set Analysis. Notice that here we are using a search string. Year = {2010}>} Sales) 5. Year = {2010}>} will give you a record set based on the current selections where Region is equal to South or North and Year is equal to 2010. Tags: Point in Time Reporting. use it as Field = {$(MyVariable)} If your variable is text. Set Analysis. So. {$<Year = {“20*”}>} will give you the record set based on the current selections where the Year matches the search string “20*”. You can use variables instead of the hardcoded Field Value: If your variable is a number. | November 27. now you should be able to get up and running creating your set expressions. Any comments are welcome! EcoPressed Eco World Content From Across The Internet. Entry filed under: Set Analysis.. FEATURED ON ECOPRESSED Solar-Powered Bulb Provides Light After Dark Share this: Like this: Be the first to like this post. The Magic Of Set Analysis.wordpress..The Magic of Set Analysis – Syntax and Examples « iQlik – Everything .. NEVER forget the equal sign here. 2010 at 2:14 pm [. 2010 at 11:20 am [. ‘North’}.. Your final expression should look similar to: Sum({$<Region ={‘South’}. Introduction Reading iPhone’s Database 7 Comments Add your own 1. meaning all years that begin with “20″.com/2010/09/11/the-magic-of-set-analysis-synta. use it as Field = {‘$(MyTextVariable)’} If your variable should be used as a search string. {$<Year = {“>=2007″}>} Will return a record set where the Year is greater than or equal to 2007. Keep Posted. The Magic of Set Analysis – Point In Time Reporting « iQlik – Everything QlikView.. Remember: This is a basic introduction and there is A LOT more to know about Set Analysis.. Also. just with an equal sign. http://iqlik. {$<Region = {‘South’. The Magic Of Set Analysis. | November 27. The Magic of Set Analysis – Part III « iQlik – Everything QlikView.... I wrote about the general syntax of a Set Expression and provided some basic examples using Set [...

com/2011/06/21/testing-the-performance-implications-of-variables-and-labelreferencing-versus-direct-expressions/ Thanks DG Reply 5... 2011 at 5:22 pm Thanks for this good info. http://iqlik.e.. i. use Field = {“$(MySearchVariable)”} In what scenario do we use search string in set analysis? Can you please provide some examples? Also. 2011 at 11:18 am Thanks Reply 4.The Magic of Set Analysis – Syntax and Examples « iQlik – Everything . Using a Label reference would be in an attempt to use different Sets for each row (supposing it is a table). 2011 at 7:48 am Thank you for sharing. Mike | August 4.wordpress. Reply 3.e. Reply 7.. I’ve sen expression ‘$($(=only(variable)))’ (i. 2011 at 11:22 pm Hi DG. Mike Reply 6. Very clear examples. 2011 at 11:30 pm 3 of 6 2011-09-22 00:32 . Taxaw | June 25. it is not possible to use a label reference as Set Modifier because the “Set” (Data QlikView will use to perform the calculation) is defined only once and applies equally across all the chart dimensions. Thanks for your comment and hope I could help. Is it set analysis? What does it mean? Thank you. Qlikview User | August 3.qlikfix. which is not possible.com/2010/09/11/the-magic-of-set-analysis-synta. DG | July 22. a label reference as is discussed here in a different context: http://www. Hi! Mike | August 4. Could I use a label reference?. You mentioned: If your variable is text. use it as Field = {‘$(MyTextVariable)’} If your variable should be used as a search string. In the case of Set Analysis. One question: In part 5 you show how to use a variable. that is the only line in the expression).

http://iqlik. It is most commonly used to get variables’ data because if your variable is an expression [for instance: Max(Year)].wordpress. but it is a topic on its own. ‘$($(=only(variable)))’ is not a Set expression.com/2010/09/11/the-magic-of-set-analysis-synta. Post Comment Trackback this post | Subscribe to the comments via RSS Feed Email Subscription Enter your email address to subscribe to this blog and receive notifications of new posts by email..The Magic of Set Analysis – Syntax and Examples « iQlik – Everything . Mike Reply Leave a Reply Log In Log In Log In Notify me of follow-up comments via email. 2011). called “Dollar-Sign Expansion” which basically I like to translate as “evaluate/compute whatever is inside the parentheses (which are preceded by the dollar sign)”. Thanks for your comment.. don’t get confused by the dollar signs.. I will also consider it for future writings here in iQlik. You may be able to find something already on the Qlik Community about the subject. with its syntax rules and everything. it will return the already-computed value (say. This is a pretty basic idea of Dollar-Sign expansion. Join 59 other followers 4 of 6 2011-09-22 00:32 .. Dollar signs represent a whole other subject. or on other blogs (Check the blogroll on the sidebar). Notify me of new posts via email.

.The Magic of Set Analysis – Syntax and Examples « iQlik – Everything ..Point In Time Reporting The Magic of Set Analysis – Part III Reading iPhone's Database The Magic of Set Analysis . Introduction Business Intelligence and Collaboration.. Recent Posts Power Up your Big Apps with Binary Index Expansion A New Choice of Armor: The Flag Matrix QlikView mobile: AJAX Touch Client Point In Time Reporting Out Of The Box The Magic of Set Analysis .com/2010/09/11/the-magic-of-set-analysis-synta. http://iqlik.wordpress.Syntax and Examples The Magic Of Set Analysis.. the Twitter way! Our Archives September 2011 (1) May 2011 (1) April 2011 (1) January 2011 (1) November 2010 (2) September 2010 (2) August 2010 (1) July 2010 (1) Post Categories Collaboration (1) Data Model (1) Goodies (2) New Features (2) Personal Use (1) Random (1) Server (3) Set Analysis (5) The Magic Of Set Analysis (5) Uncategorized (1) Calendar View September 2010 M T W T F S S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 « Aug Nov » 5 of 6 2011-09-22 00:32 .

with new Ideas functionality on #QlikCommunity.The Magic of Set Analysis – Syntax and Examples « iQlik – Everything .Point In Time Reporting The Magic of Set Analysis – Part III Point In Time Reporting Out Of The Box The Magic Of Set Analysis. 1 month ago Theme: Blix by Sebastian Schmieg ..Syntax and Examples The Magic of Set Analysis . Top Posts The Magic of Set Analysis . http://iqlik.co/XMkhAFo 1 week ago To #QlikView Developers: What do you think about having pre-cached apps for better performance? Have you tried it? Do you recommend it? 4 weeks ago RT @EricaDriver: Collaborate on the future of #QlikView. Blog at WordPress.com/2010/09/11/the-magic-of-set-analysis-synta. http://t.. 6 of 6 2011-09-22 00:32 ..co/8TQE4U0 1 month ago thus opening up possible conflicts between the cached state and the modified state from a macro 1 month ago The reason for deleting the caches etc is that it is possible to modify properties and selections from the macros.com... Introduction Blogroll Quick – Qlear – Qool QlikView Notes Perceptual Edge The QlikFix! Twitter Power Up your Big Apps with Binary Index Expansion http://t.wordpress..