5 Replies Latest reply on Jul 7, 2016 12:02 AM by Aiswarya Sundaram

Want to customize sub-total

Hello,

I have Region, country dimensions, and i have sales metric. I want to see , subtotal of sales per Region, instead of country.

For example ,the last column is showing me the Region wise subtotal that is correct .

I want to print this value only once per Region , instead of showing for all the country column.  The formula i have used to calculate the subtotal is

WINDOW_SUM(SUM([Sales]))

I have attached twbx file for your reference.

• 1. Re: Want to customize sub-total

Hi Ashis...

I'll look at others' responses but I'm not sure how *I* could do it:

How to hide some subtotals but not all?

One simple hack you can do is Formatting the Grand Total:

Remove the Label, and change the value colors to white. You might also want to change the Grand Total font to white, as well.

While this will still leave a gap at the bottom of your screen, your users won't see the Grand Total.

Good Luck!

• 2. Re: Want to customize sub-total

Thank you for your reply. I am interested to show only one subtotal per region .

• 3. Re: Want to customize sub-total

Haha! I use that hack quite a lot myself @michael. B)

Ashis,

Another workaround would be, change the total to discrete and add that before your country field on rows. Hope that helps.

• 4. Re: Want to customize sub-total

Hello Aiswarya,

That was a good hack.

I have created a flag calculated field to print 1 in all the rows except the subtotal . Using the bellow formula

If MIN([Country]) != MAX([Country]) then 0 Else 1 End

then I use the following formula to hide all the rows which has 1 with the null value. Using the following formula

if [flag]=1 THEN null ELSE (WINDOW_SUM(SUM([Sales]))+ WINDOW_SUM(SUM([Sales]))*.2) END

Note : I am adding 20% to my subtotals.

So now it looks like the following image

• 5. Re: Want to customize sub-total

Nice one, Ashis!

Might come in handy for me later.

Sent from my iPhone