# Qlik Sense Enterprise Documents & Videos

Documents & videos about Qlik Sense.

# Set Analysis - Part 2 - Cool Stuff You Can Do (video)

Employee

## Set Analysis - Part 2 - Cool Stuff You Can Do (video)

Set analysis offers a way of defining a set (or group) of data values that is different from the normal set defined by the current selections. Watch this video to learn more about the cool stuff you can do with Set Analysis as well as to get a better understanding of its expression syntax and how it can be used.

Previous Video: A Beginners' Introduction to Set Analysis

NOTE: For a more complete and deeper dive of Set Analysis check out this excellent document: Set Analysis: syntaxes, examples

Sample App: (Qlik Sense is .qvf - QlikView is .qvw)

• See attached .qvf file for sample Qlik Sense application
• If using Qlik Sense Desktop:
• Copy .qvf file to C:\Users\<user profile>\Documents\Qlik\Sense\Apps
• Refresh Desktop Hub (F5)
• If using Qlik Sense Server
• Import .qvf using the QMC and then access from My Work Stream in hub
• For the .qvw - just opened with QlikView Desktop

Set Analysis Expressions:

Conditions  (hard-coded lists,searches,wild card,comparison operators, not equal):

```Sum({\$<CategoryName={'Bath Clothes'}>}Sales)Sum({\$<CategoryName={'Bath Clothes','Babywear'}>}Sales)
Sum({\$<CategoryName={"*Clothes"}>}Sales)
Sum({\$<CategoryName={"*Clothes",'Babywear'}>}Sales)
Sum({\$<Year={'2013'}>}Sales)
Sum({\$<Year={2013,2014}>}Sales)
Sum({\$<Year={"<2014"}>}Sales)
Sum({\$<Year-={2014}>}Sales)

```

Conditions using variables:

```SET vDefaultCat = 'Bath Clothes';
Sum({\$<CategoryName={\$(vDefaultCat)}>}Sales)

```

\$ Expansion - using functions to evaluate comparisons values:

```Sum({\$<Year={"\$(=Year(Today()))"}>}Sales)

```

Conditions with multiple dimensions:

```Sum({\$<CategoryName={'Babywear'},Year={2014}>}Sales)

```
Contributor III

Hi Michael - a really dumb question - but I cannot open the Sales Analysis with Master Calendar ... what am I doing wrong?
apparently I am using an older version of QlkView 11.20.

Apart from upgrading ... what should I do next?

Jo

Employee

Hi Josephine - I am happy to hear form you, no dumb questions here . The attached example is for use with Qlik Sense not QlikView - my fault, I should have stated that more clearly. I did attach the data files if you wanted to recreate it in QlikView. I will create a .QVW and ALSO attach it to this post, so we have both for Qlik Sense and QlikView. Let me know if you have any questions, and please ask more questions in the forums and myself and others will do our best to support you.

Regards,

Mike T

Qlik

Employee

Hi Josephine - I attached a .qvw for you too - stay well.

Mike T

Qlik

Contributor III

Thank you

I really appreciated your tutorial – I was going crazy. So now I will have a happy easter ☺

Jo

Not applicable

Hi

I want sample Data modal how create and synthetic key , some data tables and examples.

Thanks,

sreenu

Employee

Hello Sreenu - all of this can be found in this document (attached to the post) and are available from varius videos and tutorials here: New to Qlik Sense Videos

Hope this helps

Mike

Contributor III

Hi Michael,

a very good video! I think that Set Analysis is one of the most powerful tools in QV and knowing how to handle it is a grate advantage for every QV-Expert.

Sometimes i have problem with this syntax : {<MyField-={XXX}>} (not always)

That dosen't works simply. Instead i use the following syntax :

{<MyField={*}-{XXX}>}

This works always

Best Regards

Peyman

Employee

Hi Peyman - thanks for your comment. Thanks for the tip. We love hearing from our users and seeing how they use the products.

Mike Tarallo

Qlik

Contributor III

Hi Michael

I made a comment yesterday but could not add a file, so I will make it again (hope there are not 2 copies and I apologise in advance if there are:

I think I have figured it out:

I did it by trial and error though. Is there a better way of doing this?

Jo

MVP & Luminary

Hi Peyman,

if you want NOT XXX, the syntax is:

{<MyField=-{XXX}>}

Note the position of the - to the right of =. That selects everything except XXX.

To the left of the = as you posted means "remove XXX from the set".

{<MyField-={XXX}>}

{<MyField={*}-{XXX}>}

reads as "select everything, then remove XXX". This is logically equivalent to the first =- example above.

-Rob

http://robwunderlich.com

Version history
Revision #:
1 of 1
Last update:
‎03-25-2015 03:29 PM
Updated by: