3 Replies Latest reply on Dec 20, 2016 5:04 AM by Tom W

# Issue in calculation of  measures.

Dear All

I have a set of 5 measure fields comprising of two whole number fields while the other three are in decimal.My final field has to be the sum of all the 5 measures.The calculations will be something like

for measure A if measure A =0 or null then

(measure A) *0.25

else measure A

end

the same will hold good for the rest of the 4 measures.

The final measure = measure A+measure B+measure C+measure D+measure E here measure A and measure B  are in whole numbers while the rest in decimals so how do i get the sum of all the 5 measures.Kindly help me

Regards

Sneha

• ###### 1. Re: Issue in calculation of  measures.

Sneha,

You can add fields together in a calculated field using the standard + operator. Depending on the aggregation required, perhaps you're going to need to use the SUM aggregation.

It's pretty difficult to provide you with specific help without seeing your data.

Can you please attach a Tableau Packaged Workbook including sample data?

1 of 1 people found this helpful
• ###### 2. Re: Issue in calculation of  measures.

Hi Tom

Sorry unable to attach the same.Yes i use the same + but since 2 measures A and measure B are whole numbers, should i modify my field as

for measure A if measure A =0 or null then

(measure A) *(0.25/100)

else measure A

end

Will this resolve by converting the whole number to a decimal.

Regards

Sneha

• ###### 3. Re: Issue in calculation of  measures.

Understand there isn't much I can do without seeing some sample data. Packaged workbooks and flows: when, why, how

Perhaps you need to wrap your measures in a FLOAT conversion - Type Conversion