3 Replies Latest reply: Mar 4, 2015 10:21 PM by John Smith RSS

    Dimension Properties

    John Smith

      Hi,

      I have  a scenario where i need to hide the Dimension based on the user selection.

      i am attaching the sample app and datasource.

      Please provide me the suggestion on this

        • Re: Dimension Properties
          Jonathan Poole

          any better ?

           

          You can add a conditional show condition on dimensions or measures.

           

          dimension tab, enable conditional:  

           

          if( SubStringCount( concat( distinct Region,';'),'US')>0 or SubStringCount( concat( distinct Region,';'),'Ind')>0, 1,0)

            • Re: Dimension Properties
              Jonathan Poole

              noticed a blank row was showing up when UK was selected with US and ind ... corrected that an uploaded new version.

               

              how it works ?

               

              the whole dimension will be conditionally hidden based on this boolean expression that evaluates to TRUE (1) or FALSE (0)

               

              if( SubStringCount( concat( distinct Region,';'),'US')>0 or SubStringCount( concat( distinct Region,';'),'Ind')>0, 1,0)

               

              the concat() function will create a delimitted list of all 'Region' values in the current selection.

               

              So if you select US, Ind, UK ..

               

              concat( distinct Region,';') will return--->   US;Ind;UK    (; is the delimitter which you can choose but its moot for this purpose)


              next part is to test if   'US' or 'Ind' is in that list and we use substringcount(  <list>, 'US')   to check if 'US' is in the list 


              If US or Ind is in the list then its a TRUE and assign 1.  Otherwise 0 and hide the whole dimension.


              Little tricky but useful one to remember.