Aggregate Multiple Text-based Columns to Card

JPeG
JPeG Member

Hello Domo Community! 

 

Long time reader, first time poster... hoping someone out there might have a solution for a relative newbie to domo and using beastmode. 

 

The Sitchdomo.PNG

I'm working with a file right now that will show pass/fail results across multiple columns. Each column represents a different category of failure, and the data in that column may either be blank (meaning non fail on that entry for that particular fail type), or it could have text. Here is the example ----->

 

Some of the 'fails' are due to a single category (column) some are multple. 

 

What do I wanna do? 

I would like to do one of two things with this data (a basic version, OR, a more advanced version) -- i'm MORE than content with the basic, but posting both in case anyone is feeling particularly codey today

Comments

  • I would suggest you look into either of these options and see what makes the most sense for you. Both of them revolve around taking data from multiple columns and putting them in a single column.

    Approach 1 - Use the Magic ETL Collapse Columns tile

    https://knowledge.domo.com/Prepare/Magic_Transforms/ETL_DataFlows/02ETL_Actions%3A_Edit_Columns#Collapse_Columns

    This KB article does a nice job of outlining how you do this. You could create a new column called FailReason and pivot each reason to that column. It would also allow you to rename certain reasons, which you indicated you want to do.

     

    Approach 2 - Create a beast mode called FailReason

    You could create a beast mode that would essentially do the same thing except that you will run into challenges when someone has multiple failures because beast modes can't pivot data and you would have to concatenate multiple reasons. Your beast mode would be a long CASE statement that would look at each column and allow you to rename a reason. A simple example would look like this:

    CASE WHEN LEFT('Fail1',2) = 'A1' THEN 'Spacing'
    WHEN LEFT('Fail1',2) = 'A2' THEN 'Something else'
    END

    After writing this out, the Collapse Columns would be your best approach to ensure you can total each fail type individually.

    **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.
  • @MarkSnodgrass  nailed it on the head.

    build a lookup table that has one row for each failure code and how you want them remapped. (cols. FailReason, FailReason_CustomGroup)

     

    then Magic + Collapse columns will be the easiest way to collapse your data.

    then JOIN the lookup and the MagicETL column

     

    to avoid inflating your failure counts 

    (ex for one ID I could failed A14 and B21 on separate rows)

     

    YOU CAN EITHER:

    use a RANK & WINDOW tile to ROW_NUMBER() partitioned by ID, FailReason_CustomGroup

    That way in your visulaization you can  filter by the first instance of each CustomGroup per ID.

     

    OR 

    use a GROUP BY tile to concatenate FailReason into one string partitioned by ID, FailReason_CustomGroup

     

     

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"