0
votes

I have a problem with Tableau.

I have a Dataset with some rows and some columns. I want to write a IFELSE structure where

The IF condition is that the Value of special field(fixed by a row and a column) is equal to the header of a column (it is every time equal to one name(header) of the different columns).

So to summarize: one value is every time equal to the name of a column and to find the column shall be the if-structure

Does someone know if there is a function to call the name (header) of a column? I didn't find it

Here is an small example, in which the Calculated_function choose the right price according to the Barcode. Everything in the first raw, is the header_name of the column below. enter image description here

Best regards

Jonas

1
it seems like you have a non relational dataset or something like an excel file which could be a little misleading... could you please share a sample of your dataset? - Fabio Fantoni
Please show your desired output through a sample data - AnilGoyal
I added a small example of the Dataset. - clanky1997
That data sample doesn't make much sense in the format it is given. What would it mean if the column had multiple values in it? - matt_black
I changed it now to different values in each column matt_black. The point is that I do not know any function in Tableau which compares the Values in the left columns with the header of the others, which is the idea to calculate the field. best regards - clanky1997

1 Answers

0
votes

You can work like this.

I created a sample dataset as given by you

Sample_input

Step-1: Connected With data in tableau. Clicked all columns having price (4 here), pivoted them so that they look like this..

After_pivoting

Step_2: Create calculated_field like this

if [Barcode] = [Barcode_c]
then [Price] END

Step3: Filtered out null values from calculatedField and got a view like this which can be tweaked as per liking.

Result