Grouping after Split Function

Mirnes
Mirnes Member
edited April 2023 in Beast Mode

So I'm running into a bit of a snag. Say I wanted to just do the Beast Mode element and pull just what's in the Title(Column) for example:

All this info is in the Title separated by a | if I wanted to pull the System name from the title and then group it along with others that come in with the same format but create a group for them to be displayed on the card.

System | Application | Client | Problem

Just need a way to take that split after and create a specific group for them, it's no more than 6 and everything else can be other.

Best Answer

  • MarkSnodgrass
    Answer ✓

    To get the "System" group, create beast mode that uses the SPLIT_PART function, like this:

    TRIM(SPLIT_PART(fieldname,'|',1))
    

    You can then use this field as your grouping and aggregation.

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

Answers

  • Can you show what you would want the end result to look like? Also, is this for a table card? Or some other visualization?

    **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.
  • This is for a card and it will be a stacked bar graph. So we have groups we work with and the ticketing service does not have an option to input that. So we use the Title which we've developed a naming convention for so we can separate them out into 4 bits of info.

    This is a random Google image since it won't let me upload my personal screenshot. I want to be able to take that one bit of information from the title and have any WO with the same first-word title and place it into the appropriate group. Hope this was enough info. Thank you!

  • MarkSnodgrass
    Answer ✓

    To get the "System" group, create beast mode that uses the SPLIT_PART function, like this:

    TRIM(SPLIT_PART(fieldname,'|',1))
    

    You can then use this field as your grouping and aggregation.

    **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.
  • Mirnes
    Mirnes Member
    edited April 2023

    That worked really well but it just looks all over the place. My next question is, is there a way to make custom groups once it's pulled from the split? So I can continuously make new groups myself. If I need to remake and create a new post for this please let me know and I will.

  • @Mirnes - I'm having difficulty understanding what you are asking. The solution that @MarkSnodgrass provided should give you a new field containing all of the first words from your original field of | separated values. Per the image provide, if you place that field as your series in the graph, it should provide you with the desired visual.

    Or are you wanting to group together multiple values into a larger group?

    Either way, I'm not a big fan of doing this kind of thing in a calculated field. Because this is something that is essentially looking at a single line of code and providing additional metadata to your dataset (it won't change based on card filters or date restrictions, etc.) I would recommend performing these calculations in a dataflow. In my opinion, this makes it easier to maintain these fields. It can also cut down on the rendering time for a page if you have a large dataset.


    “There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
  • Sorry about the confusion, learning this on the go for work. I was mainly trying to be able to make a group via that first-word split but be able to customize the group names and limit what's displayed. So example I want 5 groups that I can pick the name for and 1 other group. This way I can continuously update it if we add any new groups or naming conventions where we pull that info from.