5 Replies Latest reply: May 29, 2018 8:37 AM by Mart�n Caruso RSS

    Show on a Line Chart based on the dimension you selected in a table

    Mart�n Caruso

      Hello, good day!

      I'll tell you about the problem that I'm not able to solve: I have a table formed by an island dimension (that comes from a LOAD * Inline).

       

      2018, Q1
      Germany3.213.295
      Brazil484.193
      France84.905
      Italy923.103
      Spain128.497
      Colombia84.015
      TOTAL4.918.008

       

      The client asks me if, for example, I select "Germany" to show me the evolution for each quarter of the selected thing. The problem is that in my graphic when I select "Germany" it only shows me the value of that month. On the other hand, if I do not select anything, it does not show me anything.

      I was using alternative measures and it gave me good results. But now the client asks me to be interactive, to select what I want to see from the table and not from the graph.


      Line chart.PNG

      By the doubts, I leave you the expression of the measures:


      MEASURE OF TABLE

      If

      (

      DIM_COUNTRY = 'Germany',

      sum({ $<DIM_AGRUP = {'321', '743'}, DIM_YEAR={$(=only(DIM_YEAR))}, FLAG_ACUM_QUARTER = {'Acum'}> } DIM_SALES)

      , If

      (DIM_COUNTRY = 'Brazil',

      sum({ $<DIM_AGRUP = {'453','289'}, DIM_YEAR={$(=only(DIM_YEAR))}, FLAG_ACUM_QUARTER = {'Acum'}> } DIM_SALES)

      , If

      (DIM_COUNTRY = 'France',

      sum({ $<DIM_AGRUP = {'902', '841'}, DIM_YEAR={$(=only(DIM_YEAR))}, FLAG_ACUM_QUARTER = {'Acum'}> } DIM_SALES)

      , If

      (DIM_COUNTRY = 'Italy',

      sum({ $<DIM_AGRUP = {'519', '732'}, DIM_YEAR={$(=only(DIM_YEAR))}, FLAG_ACUM_QUARTER = {'Acum'}> } DIM_SALES)

      , If

      (DIM_COUNTRY = 'Spain',

      sum({ $<DIM_AGRUP = {'622', '890'}, DIM_YEAR={$(=only(DIM_YEAR))}, FLAG_ACUM_QUARTER = {'Acum'}> } DIM_SALES)

      , If

      (DIM_COUNTRY = 'Colombia',

      sum({ $<DIM_AGRUP = {'601', '394'}, DIM_YEAR={$(=only(DIM_YEAR))}, FLAG_ACUM_QUARTER = {'Acum'}> } DIM_SALES)

      , If

      (DIM_COUNTRY = 'TOTAL',

      sum({ $<DIM_AGRUP = {'321', '743', '453','289', '902', '841', '519', '732', '622', '890', '601', '394'}, DIM_YEAR={$(=only(DIM_YEAR))}, FLAG_ACUM_QUARTER = {'Acum'}> } DIM_SALES)

      )))))))

       

      MEASURE OF LINE CHART

      If

      (

      DIM_COUNTRY = 'Germany',

      sum({ $<DIM_AGRUP = {'321', '743'}, DIM_YEAR, DIM_QUARTER, FLAG_ACUM_QUARTER> } DIM_SALES)

       

       

      , If

      (DIM_COUNTRY = 'Brazil',

      sum({ $<DIM_AGRUP = {'453','289'}, DIM_YEAR, DIM_QUARTER, FLAG_ACUM_QUARTER> } DIM_SALES)

       

       

      , If

      (DIM_COUNTRY = 'France',

      sum({ $<DIM_AGRUP = {'902', '841'}, DIM_YEAR, DIM_QUARTER, FLAG_ACUM_QUARTER> } DIM_SALES)

       

       

      , If

      (DIM_COUNTRY = 'Italy',

      sum({ $<DIM_AGRUP = {'519', '732'}, DIM_YEAR, DIM_QUARTER, FLAG_ACUM_QUARTER> } DIM_SALES)

       

       

      , If

      (DIM_COUNTRY = 'Spain',

      sum({ $<DIM_AGRUP = {'622', '890'}, DIM_YEAR, DIM_QUARTER, FLAG_ACUM_QUARTER> } DIM_SALES)

       

       

      , If

      (DIM_COUNTRY = 'Colombia',

      sum({ $<DIM_AGRUP = {'601', '394'}, DIM_YEAR, DIM_QUARTER, FLAG_ACUM_QUARTER> } DIM_SALES)

       

       

      , If

      (DIM_COUNTRY = 'TOTAL',

      sum({ $<DIM_AGRUP = {'321', '743', '453','289', '902', '841', '519', '732', '622', '890', '601', '394'}, DIM_YEAR, DIM_QUARTER, FLAG_ACUM_QUARTER> } DIM_SALES)

       

       

      )))))))

       

      I appreciate the help you can give me.

      Regards,


      Martin.