Percentage of Sub-total

Lawrence Brown shared this question 2 years ago
Answered

Hi,


Is it possible to use the 'Percentage of Total' function but calculated for Sub-totals?


8282b14f13d98e7b754af6d9c88cfb14


I have a report that calculates the % of the total number but I'd like it to do it for the Income and Expenditure respectively, I've included an additional column to show how I'd like the end result to look.


Regards,

Lawrence

Best Answer
photo

Hi Daryle,

Since there have now been a couple of requests for this functionality, I have put together a custom advanced function to achieve this.

Upload the attached jar file through the plugin manager. The new function will be called "Sectioned Percentage of Total". Apply this to the column of choice, and select the column used for your sub-totals as the reference column. In the original example you would select MA2 as the reference column.

857f812b031229e7e346a1ad47b277ef

Let me know if you run into any problems with this.

Regards,

Nathan

Comments (9)

photo
1

Hi Lawrence,


Thanks for sending in the question. This might not be the cleanest way to express this (there might be other ways to accomplish this via Report from Report), but I think to accomplish what you are after you are going to need to consider using sub queries.


Using basic append sub queries I was able to accomplish the following:


bb4aa290f595c2c5cb44c46ea8b8988a


In your case, the master query would contain your MA2, MA4, BUD, and % of Total columns. Then you could create an individual sub query for income and expenditure each (filtering the sub query by either income or expenditure to limit the sub query results) to produce an individual % of Total.


If you you haven't worked with sub queries before, our wiki has some great information on the subject:

http://wiki.yellowfin.com.au/display/USER72/Append+Sub+Query


Can you review this and let us know if this solution could work for you, or if you have any follow-up questions here? I look forward to hearing back!


Kind Regards,


Dustin

photo
1

Is this still the best way to calculate the % of subtotal?

photo
1

Hi Daryle,

Since there have now been a couple of requests for this functionality, I have put together a custom advanced function to achieve this.

Upload the attached jar file through the plugin manager. The new function will be called "Sectioned Percentage of Total". Apply this to the column of choice, and select the column used for your sub-totals as the reference column. In the original example you would select MA2 as the reference column.

857f812b031229e7e346a1ad47b277ef

Let me know if you run into any problems with this.

Regards,

Nathan

photo
1

I am going to set this ticket to closed for now, but if there is anything else I can do to help here, please just let me know and the case will be re-opened!


Regards,

Nathan

photo
1

Hi Nathan

I wanted to use your plug in but in my YellowFin installation (7.4.7), there is no Plugin Management link in the Administration section on the right of the Admin console (as per https://wiki.yellowfinbi.com/display/USER74/Install+Plug-in)

Is this a bug or is there a setting needed to enable plugins? My user has the admin role.


Thanks

Greg

photo
1

Hi Greg,

Chances are, your user is lacking the appropriate role permission for this. It should be "Plugin Management" under the administration section.

Nathan

photo
1

Thanks Nathan. I finally found the Plugin Management setting under the Administration setting and enabled it for the admin role.

Greg

photo
photo
1

Hi Nathan,

Could you attach the source code for the custom advanced function?. It woul be helpful to understand how to create one which receives the name of a column as a parameter (eg. the reference column in this case).

Good bye,

Gabriel

photo
1

Hi Gabriel,

I have attached the source code for this.

Nathan

photo