Calculating the total of a column

Reply
White Belt

Calculating the total of a column

trying to calculate the percentage of the total for each row in Beast mode. the formulas I have found don't work, because the SUM function only takes one single value per row instead of aggregating all of them. The percentage for each row is 100%. What formula should I use to get a total for all the values under a single column? I also tried ETL with no luck. 

thanks,

 

`actual_hours`
/
(SUM(
Case when `active` = 'true'
THEN `actual_hours`
ELSE 0
END))

 

 


Accepted Solutions
Brown Belt

Re: Calculating the total of a column

I believe you would need to do this within a data flow. You would want to add a column to the dataset that includes the total for given category.

 

For example:

 

DateEmployeeGroupActual HoursTotal Group Hours
6/21/17JillCustomer Service6.543
6/21/17BerniceSales745
6/21/17JeffSales7.2545

 

You would need to create a branch in your Magic ETL that got the total hours for each group. Then you would join it back to your branch that has the actual hours for the employee based on the Group field. Then in the Card Builder you would create a BeastMode that looks like this:

 

=Actual Hours / Group Hours

 

KurtF
**Say “Thanks” by clicking the “heart” in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"

All Replies
Brown Belt

Re: Calculating the total of a column

I believe you would need to do this within a data flow. You would want to add a column to the dataset that includes the total for given category.

 

For example:

 

DateEmployeeGroupActual HoursTotal Group Hours
6/21/17JillCustomer Service6.543
6/21/17BerniceSales745
6/21/17JeffSales7.2545

 

You would need to create a branch in your Magic ETL that got the total hours for each group. Then you would join it back to your branch that has the actual hours for the employee based on the Group field. Then in the Card Builder you would create a BeastMode that looks like this:

 

=Actual Hours / Group Hours

 

KurtF
**Say “Thanks” by clicking the “heart” in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"
White Belt

Re: Calculating the total of a column

please give the steps in mysql, especially join.

 

Yellow Belt

Re: Calculating the total of a column

Hi

How do you create a column in ETL that sums an entire column?

I am trying to create a card that gives percentage of total, and from what I can see in this post, this will be the best way to do it.

But I can't figure out how to create a Total column.

Thanks

Simon

Brown Belt

Re: Calculating the total of a column

Since my first response, new functionality has been added to Magic ETL for this. You can use a Rank & Window tile. Check out the documentation at this link:

https://knowledge.domo.com/Prepare/Magic_Transforms/ETL_DataFlows/03ETL_Actions%3A_Rank_and_Window

 

At a high level, you will use the Rank & Window tile to create an overall total column. The output will be similar to what is represented above. The documentation should be sufficient to get you where you need to go.

KurtF
**Say “Thanks” by clicking the “heart” in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"
Visitor

Re: Calculating the total of a column

Hi.

 

This solution works for the single visualisation of showing the `Actual Hours / Group Hours` by Employee and Group and Date.

How about if I want to use the same dataset to show `Actual Hours / Group Hours` by only Group and Date?

Announcements
Looking for the latest Community solutions? Please visit our accepted solutions board here!