Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
May 13, 2022 5:58:28 PM
Mar 25, 2015 3:29:11 PM
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)
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)
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
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
Hi Josephine - I attached a .qvw for you too - stay well.
Mike T
Qlik
Thank you
I really appreciated your tutorial – I was going crazy. So now I will have a happy easter ☺
Jo
Hi
I want sample Data modal how create and synthetic key , some data tables and examples.
Please Help Me
Thanks,
sreenu
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
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
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
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
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