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. 



Case when `active` = 'true'
THEN `actual_hours`



Best Answer

  • KurtF
    Accepted Answer

    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


    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



  • please give the steps in mysql, especially join.


  • 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.



  • 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:


    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.

  • 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?