Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
369 views
in Technique[技术] by (71.8m points)

Data Studio Calculated Field - Calculation Not Correct

I can't seem to find why the calculation within my calculated field isn't providing the correct output.

SUM(CASE 
WHEN CONTAINS_TEXT(Groups,"27797") 
AND NOT CONTAINS_TEXT(Groups,"6175")
AND NOT CONTAINS_TEXT(Groups,"3929")
AND NOT CONTAINS_TEXT(Groups,"2269")
THEN _Sale
ELSE NULL
END)/SUM(Total Registrations)

Note: Below is CASE statement for "Total Registrations" field.

CASE
WHEN CONTAINS_TEXT(Groups,"27797") THEN 1
ELSE 0
END

When the CASE statement is processed separately it results in the correct value which is $1,000,000. "Total Registrations" is also a calculated field which when run by itself results in the correct value of 1,386. If those are divided then the value should come out to $721.5. However, the calculated field as shown above comes out to $923.52. I have no additional filters applied to either calculated field.

question from:https://stackoverflow.com/questions/65892533/data-studio-calculated-field-calculation-not-correct

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...