3 Replies Latest reply on May 1, 2016 8:00 AM by Picon Carlos

Hi, I am trying to calculate workshop hours for different equipment and parts.  For this problem, I have multiple types of Equipment and each with different parts and equivalent hours required to repair those parts.  I am able to calculate repair hours for 1 type of equipment but don't know how to create a formula that will calculate hours based on the particular equipment and parts for that equipment type.

Here is what I do know and is a valid formula:

IF [Part Name1]= "R1 Buckets" THEN [Number of Sets] * 1714 ELSEIF

[Part Name1]= "R2 Buckets" THEN [Number of Sets] * 876 ELSEIF

[Part Name1]= "R3 Buckets" THEN [Number of Sets] * 648 ELSEIF

[Part Name1]= "Flow Sleeve" THEN [Number of Sets] * 230 ELSE

0 END

however the above only works for one type of equipment [Frame].  I need to be able to choose form different types of [Frame] and then amount of hours by multiplying by the [Number of Sets] and respective amount of hours for each part that it takes to repair.

Here is what I don't know:

I am wanting to add different equipment types [Frame] and then the respective formula to calculate the amount of sets times the amount of hours per part.  There are multiple [Frame] types and each parts has different repair hours.

IF [Frame] = "GE7EA" AND

[Part Name] = "1st Bucket" THEN [Number of Sets] * 500 IF

[Part Name] = "1st Nozzle" THEN [Number of Sets] * 350

Or

IF [Frame] = "SW501" AND

[Part Name] = "2st Bucket" THEN [Number of Sets] * 500

[Part Name] = "3st Nozzle" THEN [Number of Sets] * 350 ELSE

0 END

Hi,

I probably wouldn't recommend a large amount of IF statements in this case.

What you could consider instead is creating a small secondary dataset that contained all your rates, you could then blend that in and use that in your calculation

so you could use a table like this (I just created it in excel and pasted it into Tableau)

Then you can create a calculation like this:

SUM([Number of Sets])*ATTR([RateCard].[Factor])

This is a lot simpler than writing all the various nested IFs and CASEs and maintaining a large calculation.

Hope this helps, example attached

Dave

InterWorks