Skip to main content
Announcements
Document boards are being consolidated, this board no longer allows NEW documents READ MORE

Set Analysis: syntaxes, examples

cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis: syntaxes, examples

Attachments

For those that find this document in a search - you may also want to check out these videos to learn Set Analysis:

A Beginners' Introduction to Set Analysis

About the attached document:

The doc is organized by question:

- to select all or just known members

- to select through search strings, variables that can store just members but also the whole set

- to select using two fields, a boolean test, a function like concat(), sum(), p() or e(), rank()

In this updated version, I have added some few sections and some examples.


It is a translation of a french doc I have written few weeks ago: http://community.qlik.com/docs/DOC-4889

Comments
tim_at_ford
Contributor III
Contributor III

To whoever can help me!!

I want to do a YOY analysis for my KPI.  I have five years of data.  I want to subtract out the counts of 01/01/2018 thru 08/29/2018 against 01/01/2017 thru 08/28/2017, a YOY.

Now I know this algorithm is wrong (being new to Qlik View Set Analysis)

=Num(Count({<Salesdate={"<=$(vCurrentDate)"}>}indictor) - count({<Salesdate={"<=01/01/2018"}>}indicator)
   - Count({<Salesdate={"<=$(vPrevDate)"}>}indicator)    - count({<Salesdate={"<=01/01/2017"}>}indicator), '###,##0')

However, individual everything for each year works fine!  I get my 2018 and 2017 counts individuals so I know I'm doing my set analysis correctly.

Where I run into issues is how to perform an arithmetic operation on both sets.  I know I'm supposed to get a negative number.  My first set has 900 records (2018) and my second set has 2,300 (2017).   I should get a negative number!!

Am I using the correct functions?   I have review a lot of material and it all appears to be just  comparing year to year not YOY.

Thanks for any help

 

 

 

0 Likes
Ezir
Creator II
Creator II

This is very helpful!

0 Likes
maverick1984_c
Contributor II
Contributor II

Thank you a lot to the author !!! This is probably the most complete and well explained guide on Qlik set analysis  on all the web !!! Really appreciated !!!

0 Likes
Arto_Kukkonen
Contributor II
Contributor II

Hi All,

could someone inform me is this kind of script possible to do in load script:

If(Value1=2 and (Sum(DISTINCT(if transactiondate>= Today()-243,Period1)))+Sum(DISTINCT(PeriodRest)))<=243 and (Sum(DISTINCT if transactiondate>= Today()-243,Period1))+Sum(DISTINCT(PeriodRest)))>=183,
Sum(DISTINCT if transactiondate>= Today()-243,Period1))+Sum(DISTINCT(PeriodRest))) as Kategoria1,

the end of script is Group....

That kind of script works fine in set analysis but I want this information stright to my datamodel.

Thanks in advance!

Bala69126
Contributor
Contributor

It's a great job and very useful for beginners.

0 Likes
9985399745
Contributor
Contributor

VERY GOOD

0 Likes
Version history
Last update:
‎2013-09-26 04:24 AM
Updated by: