1 Reply Latest reply on Aug 12, 2016 3:49 PM by Shinichiro Murakami

# can't get semi-additive measure to show correct value for subtotals.

Hi, I have a measure which represents point-in-time inventory levels.  I'd like to accomplish what you can see in the following image:

where the subtotals reflect the measure value for the last period, i.e., final month of the quarter, or final month of the year.

i can get this to work (using tip #9 from here: Top 15 LOD Expressions | Tableau Software )  when subtotaling is not turned on, e.g.:

but turning on subtotals doesn't respect the same logic, i.e., that Total line should read 223,428

thanks, steph.

• ###### 1. Re: can't get semi-additive measure to show correct value for subtotals.

Swierenga,

I think I made it.

Create hierarchy and fold/unfold brings appropriate number.

[End of Q]

{fixed [QTR]: sum(if {fixed[QTR] : max([Month])}=[Month] then [Value] end)}

[End of Y]

{fixed [FY]: sum(if {fixed[FY] : max([Month])}=[Month] then [Value] end)}

[End of Period]

IF contains(attr([Month])," M ")

THEN sum([Value])

elseif contains(attr([QTR])," Q ")

THEN attr([End of Q])

ELSE SUM([End of Y])

END

Thanks,

Shin

9.2 attached.

1 of 1 people found this helpful