6 Replies Latest reply: May 9, 2017 4:18 PM by Robert Svebeck RSS

    Case Statement in Dimension Qlik Sense

    William Christensen

      Hi Qlik Community, I am trying to create age groupings for a dimension. In this example, I want to count customers in each age category. Currently I am making these derived category types in the load script but occasionally the business wants to test how things would look, given different ranges. This is a bit of a hassle to modify the script just to preview the data. How can the case statement below be rewritten to work in the formula for the dimension for a given visualization? 


      when age <18 then 'Under 18'
      when age between 18 and 24 then '18-24'
      when age between 25 and 34 then '25-34'

         when age > 34 and 34 then '34 Plus'