Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION

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

100% helpful (1/1)
cancel
Showing results for 
Search instead for 
Did you mean: 
Michael_Tarallo
Employee
Employee

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

Last Update:

May 13, 2022 5:58:28 PM

Updated By:

Michael_Tarallo

Created date:

Mar 25, 2015 3:29:11 PM

Attachments

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)

Conditions with measures:

Sum({<[Model Variation]={"=SUM(PartSales) >=1000"}>}PartSales)

Labels (1)
Comments
josephinetedesc
Creator III
Creator 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

0 Likes
Michael_Tarallo
Employee
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

0 Likes
Michael_Tarallo
Employee
Employee

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

Mike T

Qlik

josephinetedesc
Creator III
Creator 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.

Please Help Me

Thanks,

sreenu

0 Likes
Michael_Tarallo
Employee
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

0 Likes
azimabadi
Creator III
Creator 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

Michael_Tarallo
Employee
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

0 Likes
josephinetedesc
Creator III
Creator 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

0 Likes
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

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}>}



Your workaround you posted:

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

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

-Rob

http://masterssummit.com

http://robwunderlich.com

Contributors
Version history
Last update:
‎2022-05-13 05:58 PM
Updated by: