I have field where I need to group by the first word of the various lines.
Line 1: Voice - Federal Regulatory Assessment Fee
Line 2: Voice - Federal Universal Service Fund
Line 3: Workspace - Google Workspace Enterprise Standard - Commitment - 6252721784-04 - 3/1/2025 - 3/31/2025
Line 4: Workspace - Google Workspace Frontline Standard - Commitment - 6257751899-02 - 3/1/2025 - 3/31/2025
Line 1 and 2 needs to be grouped under Voice.
Line 3 and 4 needs to be grouped under Workspace - Commitment - 3/1/2025 - 3/31/2025
There are more lines on the attached template - this is just to explain the requirement.
Please check and let me know if this works correctly for you.
I’m also sending you a video that explains how grouping and sum definition works, in case you get an unexpected result.
The ask changed to list all lines where WLPFreeTextHeaderTmp/WLPFreeTextTmp/@Name contains the words “Voice” and “Workspace” separately, each with subtotals. So assuming this will be two separate tables, I used a list with an iif function to only display the “Voice” lines. This however doesn’t work well with the Quantity or Amount fields as it’s picked up as a string and not a number. Is there a different way to separate the lines based on what the field starts with?
I modified the template to meet your requirements. I applied three tables where I used List tagging element and filtered the content to just get the values I want. The first list only shows names which start with “Voice”, the second list only shows names which start with “Workspace” and the third list shows everything else. I applied conditional logic on each of the list, so it only shows if it contains some data.
The trick is in the filter (see the part, marked with orange rectangle above). The same filter is applied in the If tagging element and in SummaryField tagging element, which calculates the LineAmount sum of the filtered records.