2 Replies Latest reply: Jun 13, 2016 7:16 AM by Sumit Sahu RSS

    Using variable in SET analysis

    Sumit Sahu

      Hi all,

      I have a very basic doubt on using variable in SET analysis in Qliksense.

      In table i have have three columns, as shown below:

       

      eventdatemonthamount
      31-05-20162016_52
      31-05-20162016_53
      31-05-20162016_516
      31-05-20162016_521
      31-05-20162016_522
      31-05-20162016_525
      31-05-20162016_534
      31-05-20162016_538
      31-05-20162016_548

       

      I want to calculate sum of amount for last month (2016_5).

      Now for this,

      I am creating a variable which is year_month.

      In script i created this variable as:

      set vmonth_1=(year(today()))&'_'&(month(today())-1);

       

      Now, i am writing set analysis for this:

      sum({<month={'$(=vmonth_1)'}>} amount)

       

      but this statement doesn't seem to work and result shows as "-". I am really confused with this, appreciated if anyone can help me on this.

       

       

      Thanks