Datasets

Datasets

Beast Mode Calc - calculation in rows

Hello,

Am I able to do a calculation like this in Beast Mode? From reading through, it seems like the formulas in Beast Mode are column oriented, but can I do a calculation to create new rows within the sheet itself?

Thanks for the help, Community!

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In

Best Answers

  • Answer ✓

    USA Beast Mode:
    (CASE WHEN `Country` = 'USA' AND Fruit = 'Oranges' THEN `Picked` ELSE 0 END +
    CASE WHEN `Country` = 'USA' AND Fruit = 'Apples' THEN `Picked` ELSE 0 END) /
    CASE WHEN `Country` = 'USA' AND Fruit = 'Pineapples' THEN `Picked` ELSE 0 END

    Mexico Beast Mode:
    (CASE WHEN `Country` = 'Mexico' AND Fruit = 'Oranges' THEN `Picked` ELSE 0 END +
    CASE WHEN `Country` = 'Mexico' AND Fruit = 'Apples' THEN `Picked` ELSE 0 END) /
    CASE WHEN `Country` = 'Mexico' AND Fruit = 'Pineapples' THEN `Picked` ELSE 0 END

    If I solved your problem, please select "yes" above

  • Answer ✓

    The BeastMode could be written without the Country:

    (sum(CASE WHEN Fruit = 'Oranges' THEN Picked ELSE 0 END) +
    sum(CASE WHEN Fruit = 'Apples' THEN Picked ELSE 0 END) )/
    sum(CASE WHEN Fruit = 'Pineapples' THEN Picked ELSE 0 END)

    And the way you would "pivot" by country is by using country as a variable:

    image.png

    You could literally use a pivot table, too, but basically all the Domo cards work on the same logic as a pivot table, where the variable are saying how to split up the data.

    image.png

    Please 💡/💖/👍/😊 this post if you read it and found it helpful.

    Please accept the answer if it solved your problem.

Answers

  • Answer ✓

    USA Beast Mode:
    (CASE WHEN `Country` = 'USA' AND Fruit = 'Oranges' THEN `Picked` ELSE 0 END +
    CASE WHEN `Country` = 'USA' AND Fruit = 'Apples' THEN `Picked` ELSE 0 END) /
    CASE WHEN `Country` = 'USA' AND Fruit = 'Pineapples' THEN `Picked` ELSE 0 END

    Mexico Beast Mode:
    (CASE WHEN `Country` = 'Mexico' AND Fruit = 'Oranges' THEN `Picked` ELSE 0 END +
    CASE WHEN `Country` = 'Mexico' AND Fruit = 'Apples' THEN `Picked` ELSE 0 END) /
    CASE WHEN `Country` = 'Mexico' AND Fruit = 'Pineapples' THEN `Picked` ELSE 0 END

    If I solved your problem, please select "yes" above

  • Thanks @ColemenWilson for the reply. This works. If I have many more countries, would I need a beast mode for each one like this?

    The analogous situation in Excel is using a Calculated Item instead of a Calculated Field in a PivotTable.

  • Answer ✓

    The BeastMode could be written without the Country:

    (sum(CASE WHEN Fruit = 'Oranges' THEN Picked ELSE 0 END) +
    sum(CASE WHEN Fruit = 'Apples' THEN Picked ELSE 0 END) )/
    sum(CASE WHEN Fruit = 'Pineapples' THEN Picked ELSE 0 END)

    And the way you would "pivot" by country is by using country as a variable:

    image.png

    You could literally use a pivot table, too, but basically all the Domo cards work on the same logic as a pivot table, where the variable are saying how to split up the data.

    image.png

    Please 💡/💖/👍/😊 this post if you read it and found it helpful.

    Please accept the answer if it solved your problem.

Welcome!

It looks like you're new here. Members get access to exclusive content, events, rewards, and more. Sign in or register to get started.
Sign In