6 Replies Latest reply on Oct 16, 2018 2:55 AM by amar savale

    Parameter + Calculated field, filters a dimension

    Maxime Huot

      Hi guys.


      I was wondering if someone could help me with a formula i'm struggling with.


      So, I have a dimension called "Product" which contains my products as well as my competitors product.

      Also the dimension "Product" contains 10 products from 1 to 5 my products and from 6 to 10 competitors products



      My goal is to create a button which will allow me to choose either "my products" or "my competitors products".


      what i've tried:


      create a paramater with two options "my product" ; "my competitors product"


      create a calculated field: IF [Parameter].[Product_Button]="My product"

                                              THEN [Product]= "1"  AND [Product]= "2"  .... 

                                              ELSE  [Product]= "6" AND [Product ]= "7"  ....



      in other words i don't know how to tell tableau that if it's "my product" it has to take the products from 1 to 5 but if it "my competitors product" it should take products from 6- 10



      PS: Product is a string, i put numbers just to make it anonymous and easier to write.



      Thank you guys in advance !