11 Replies Latest reply: Jul 28, 2013 6:16 AM by sathia200k RSS

set analysis


how to be very strong in set analysis, how to go for it to be expert in this

  • Re: set analysis










  • Re: set analysis
    Mayil Vahanan Ramasamy



    Please refer this link.

    It gives tips and learn about set analysis




    Hope that helps

  • Re: set analysis
    Renjith Pl

    The very basic tips to use a set


    First, write simple Sum


    Next, Leave a Space between open bracket and Sales

         Sum( Sales)

    then, Put the set syntax inbetween the space

         Sum({< put your set here >} Sales)

    then, think about which set you want to try,

    Eg- i want the latest year sales or the selected year sales only,

    then for above eg, try this in between the set

    Sum({< Year = { $(=Max(Year)) } >} Sales)



    Max(Year) will give the latest year sales, when you try in a text box you try as =Max(Year) which will result in eg(2012),

    Year = Max(Year)

    you should put "=Max(Year)" in a open and close bracket (=Max(Year)) then put one $ infront of it to treat it as value     $(=Max(Year))

    Read the Qlikview-Set-Analysis-Presentation.pdf to understand more about teh syntax and rest of the things

    when you write your first set like above, you will learn automatically rest of it


    Set anaysis with syntax looks scary but when you try like above you will able to write your own sets.

    All the best.

    Sorry if i am wrong guys...

    • Re: set analysis

      I want to know that , in set analysis when I am writing any condition for selection ,

      ex. =sum({$<CategoryName={"=sum({1-$<[Category Desc]={'0-3 Years'}>}Sales)>0"}>}Sales)


      what would be the result of above condition,

      when I execute this , is it the data excluded from whole data of [Category Desc]={'0-3 Years'} or what exactly the data is????


      and when I am selecting any other criteria , what data I will get after above set condition??


      pls can any one explain me how does this work exactly??

    • Re: set analysis

      Hi Renjith,


           Your suggestion helped to understand setanalysis easily..Can you please tell me if i want to get the customers sales for the particular year and also to compare with the previous year. I tried the below one to get the result


      sum({$<Year={$(=OnlyYear))}>} Sales)



      Thanks in advance


      • Re: set analysis
        Renjith Pl



        selected year/max year sales-

        Sum({<YEAR = {"$(=max(YEAR))"}>}Sales)


        one year minus from selected year/max year

        Sum({<YEAR = {"$(=max(YEAR)-1)"}>}Sales)


        customer sales


        aggr (Sum({<YEAR = {"$(=max(YEAR))"}>}Sales), Customer)

    • Re: set analysis

      Beautiful Renjith... Hats off to you... thanks for simplifying the concept.... its so nice compare to the pdf....

  • Re: set analysis
    Renjith Pl

    you can try your set in straight table without renaming the expression, bring your mouse over the expression you create, it will show you whether you got the result right or wrong.


  • Re: set analysis
    Gabriel Oluwaseye



    If you want to know Set Analysis, you have to understand 3 part of Set Analysis: SET IDENTIFIER, SET MODIFIER & SET OPERATOR.


    Use the attachment from Mayil Vahanan or pick up Reference manual for QlikView.