1 Reply Latest reply: Aug 4, 2014 10:52 AM by James Dixon RSS

    Show only current selection in x axis label

      Hello,

       

      I have been searching around and have found some variations on this subject but would like to know if there is a definitive answer.

       

      I have a bunch of products on the x axis (which will show all products even on a specific product selection). Depending on my product selection, I would like to be able to show that particular product name in the x axis label and then blank out the rest of the product names. There are several attempts that I have done so far, the most successful being attempt number 1:

       

      (1) Created new expression with the following formula:

       

      If(productname='$(vproductname)',productname,' ')

      Where vproductname is the following: =GetFieldSelections(productname)

       

      This works but the product names are being half cut off from the bottom of the graph, is there a way to extend the distance between the x axis and the edge of the graph area so that it wont cut off the product name?

       

      (2) A more dynamic way would be to change the font colour depending on the current selection, so go to axes->axis color->font->colour-<calculation expression and then using something like:

      productname='$(vproductname)' but this doesnt seem to work? Any suggestions as this would be the preferred method.

       

      Thank you in advance,

       

      James

        • Re: Show only current selection in x axis label

          What about creating a mapping table, so I have a mapping table something like:

           

          ProductMap

          LOAD * INLINE [

          Product, Number

          Oranges, 1

          Apple, 2

          Pears, 3

          Bananas, 4];

           

          ProductNumberTable:

          LOAD DISTINCT Product

          RESIDENT ProductTable;

           

          LEFT JOIN

          LOAD

          Product,

          ApplyMap('ProductMap',Product,"N/A") As ProductNumber_

          RESIDENT ProductNumberTable

           

          Then could I somehow use an if statement to ensure that the if(Product=v(ProductSelection),v(ProductSelection),ProductNumber_)

          I have tried this but it just deletes information if you put it as a dimension. And using it as an expression works but again, it cuts off the bottom of the product names. Is there a way to extend the area below the x-axis?

           

          Cheers,

           

          James