1 Reply Latest reply: Jun 13, 2015 4:32 AM by Ashish Tuti RSS

    Qlikview new Column with count of another column in 3 range

      aaa
      10
      9
      5
      7
      21
      25
      27
      51

      i want to get another column say BBB

      as

      bbb
      4
      3
      1

      this count of

      aaa<=10

      aaa>10 and aaa<=30

      aaa>30

       

      how can we get this

        • Re: Qlikview new Column with count of another column in 3 range
          Ashish Tuti

          interval match can be used:

           

          use this script

           

          Inline_table:

          LOAD * Inline [

          from, to, aaa_Range

          , 10, <=10

          11, 30, >10 and <=30

          31, , >30

          ];

           

          table_1:

          load

               aaa

          from table1;

           

          Left join(table_1)

          Intervalmatch(aaa)

          LOAD from, to

          RESIDENT Inline_table;

          Left join (table_1)

          LOAD * resident Inline_table;

          drop table Inline_table;

          drop fields from, to from table1;

           

          left join(table_1) // do not join of you want result in another table, if you join then bbb will be repeated

          load

               aaa_Range,

               count(aaa_Range) as bbb

          resident table_1

          group by aaa_Range;