Beast Mode calculation

Hello,

I'm creating a visualization that aims to show orders that have a specific piece of equipment in it. My database has multiple rows of 'SO #', 1 row for a different type of equipment ordered. I want to see how many orders out the total have number '100' in column 'Equipment #'. In other words, for each 'SO #' I want to mark it as a 1 if it includes '100' in column 'Equipment #' and 0 if it doesn't include '100'.

Thanks!!

Best Answer

  • ColemenWilson
    edited June 2023 Answer ✓

    I would do it in a dataflow. In Magic you would use the formula tile to get the flag on rows with a 100 in them and then use the group by tile to group on SO # and then join on SO # back to your granular data. Then you'd have a flag for each SO # that has an order product in it with 100 as shown in my last screenshot above. See below and let me know if you need more details:

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

Answers

  • Hi zuchu, see below for the beastmode to use:

    CASE WHEN 'SO #' LIKE '%100%' THEN 1 ELSE 0 END
    

    Review your data carefully because this would also pull in anything like '100' will be marked as 1. So, for example, 1001 would be counted even though it is not 100. If your order numbers don't have anything before or after the 100 you can remove one or both of the '%' signs.

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

  • zuchu
    zuchu Member

    @colemenwilson sorry if I caused some misunderstanding. Correct me if I'm wrong but but creating that case statement I'm looking at SO# that are like 100. I want to look at every single quote as a separate case, then look at 'Equipment #' (that's another column) and if for any 'SO #' there is an entry stating that 'Equipment #' is '100' then classify that order as 1, otherwise if the order didn't have 'Equipment #' 100, just leave it 0. Does that makes sense now??

  • Sounds like you just need to look at the Equipment # column for your beast mode, which evaluates by row automatically. It would look like this:

    1. CASE WHEN 'Equipment #' LIKE '%100%' THEN 1 ELSE 0 END

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • Okay I think I see what you are saying. You want an output like this right:

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

  • zuchu
    zuchu Member

    @colemenwilson thats exactly what my dataset looks like!! Once I have the the flagged version, I'll use distinct SO # and will have my answer :) Do you know how to make that calculation?

  • ColemenWilson
    edited June 2023 Answer ✓

    I would do it in a dataflow. In Magic you would use the formula tile to get the flag on rows with a 100 in them and then use the group by tile to group on SO # and then join on SO # back to your granular data. Then you'd have a flag for each SO # that has an order product in it with 100 as shown in my last screenshot above. See below and let me know if you need more details:

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