3 Replies Latest reply: Apr 2, 2018 7:33 PM by Mario Segal

# 100% Stacked Bar with Conditions on Set

I am trying to build a 100% stacked chart, however I have 2 filters on the chart that I applied as set conditions too

a specific quarter using a variable, and a specific  cross border grouping (we have 3 types), in addition I have a dimension of [Year Qtr] and a dimension of [Region] on teh chart - the region is for bar colors, and the quarter is because otehrwise I can't do the stacked (even though it is filtered to only one)

if I do this

sum ( { \$<[Year Qtr]={"\$(last_quarter)"}> +  <[Cross Border 3 Values]={'Intra'}> }  [Fraud Net Det Amt USD])

I get the correct values for my variable of interest

But when I add the divisor

sum ( { \$<[Year Qtr]={"\$(last_quarter)"}> +  <[Cross Border 3 Values]={'Intra'}> }  [Fraud Net Det Amt USD])

/

sum ( {\$ <[Year Qtr]={"\$(last_quarter)"}> +  <[Cross Border 3 Values]={'Intra'}>}  total [Fraud Net Det Amt USD])

I do not get the some of those values, so the % do not add upt o 100%

I understand the total is somehow negating the selections or one of them, but I do not know how to fix this

Any help will be appreciated

• ###### Re: 100% Stacked Bar with Conditions on Set

I guess I figured out my question,

(sum ({\$ <[Year Qtr] = {"\$(last_quarter)"}, [Cross Border 3 Values]={'Domestic'}> }  [Fraud Net Det Amt USD]) )

/ (sum(total  { <[Year Qtr] = {"\$(last_quarter)"},[Cross Border 3 Values]={'Domestic'}, [Iss Region]=>} [Fraud Net Det Amt USD]) )

Does anybody has a link to a good reference on set functions, it took me a while to find that [Iss Region]= will apply to total across that one only

• ###### Re: 100% Stacked Bar with Conditions on Set

This would be very helpful. I got it from community only, so credit goes to whoever shared it over here.

• ###### Re: 100% Stacked Bar with Conditions on Set

Thanks, very useful document