4 Replies Latest reply: Jun 29, 2017 9:58 AM by Haroun Zidane RSS

    Alternative Measures / Dimensions or Filters & Set Analysis

    Haroun Zidane

      Hello,

       

      I am currently discovering QlikSense and I don't know how to use all its features yet. I need some help using Bar Charts (or histograms) and alternative measures / dimensions.

       

      I have imported data from a csv file. A sample of the data would look like this :

       

      ProductSales_idDateValue
      P1id12017-05-0110
      P1id22017-05-013
      P1id22017-05-015
      P1id42017-05-028
      P1id52017-05-0215
      P2id12017-05-011
      P2id42017-05-022
      P2id62017-05-034

       

      I want to create a bar chart that will give the number of product sold per day for a specific product, but I want to be able to select the product on the chart. Here is the illustration of the result I would expect :

      P1 (1).pngP2 (1).png

      I think the pseudo code would be something like :

          if PRODUCT = 'P1'

                then X = Date

                        Y = Number of sales per day = Count( Sales_id )

      And for the alternative measure, the code would be the same but with the condition PRODUCT = 'P2', which would allow the user to select the product on the Y axis.

       

      Is it possible to do this with QlikSense, and if so, how ?

      Any help would be greatly appreciated.

       

      Thanks a lot !

       

      Haroun

        • Re: Bar Charts / Histograms & Alternative Measures / Dimensions
          Gysbert Wassenaar

          The easy way out is to simply select the Product value you want to see the bars for. Add Product as dimension to the bar chart. Then simply select the Product value you wish to see. Unfortunately removing the selection can't be done from the chart itself. So you may want to add a Filter Pane object for the Product dimension instead and make the selections in the Filter Pane instead.

            • Re: Bar Charts / Histograms & Alternative Measures / Dimensions
              Haroun Zidane

              Thanks for the tip. I ended up using a filter pane because I didn't find any other option, but I wanted to use a solution more "script oriented", based on this structure : Count( {<Product = {'P1'} >} sales_id) but with the possibility of adapting this for any value of the dimension Product.

              For another example : let's say I want to get the sum of all values for the minimum date of the table, I would write it like this :

              Sum({<date = {min(date)} >} Value) or maybe even Sum( if(date = min(date), Value )

              which would result here in 10+5+3+1 = 19

              But the problem in my example seems to be min(date) which is not interpreted by QlikSense, and only the string '2017-05-01' does work but I want to be able to do this without knowing the minimum date of my table for this calculation.


              Any further help on this topic would be appreciated thanks a lot