cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SukhRehal
Regular Visitor

Group by single field

Hi everyone, I need some help with the below. I did ask a follow on question here but it probably needs to be a separate question of it's own. 

 

What I trying to achieve is group the location field so that a unique entry only appears once for the LOCATION, is this even possible?

 

 

"<table border='1' width='100%'>" &
"<thead><tr><th>Location</th><th>Items</th></thead>" &
"<tbody>" &
Concat(
    gal_InstallationItems.AllItems,
    "<tr><td>" &
        GroupBy(Location) &
        "</td><td>" &
        Concat(Split(Item, ";"), Result, "<br/>") &
        "</td></tr>") &
"</tbody></table>"

 

 

Also please delete this post if I shouldn't have created it. 

 

Thank you again,

1 ACCEPTED SOLUTION

Accepted Solutions

@SukhRehal ,

What about this ?

 

"<table border='1' width='100%'>" & "<thead><tr><th>Location</th><th>Items</th></thead>" & "<tbody>" & Concat(
    GroupBy(
        gal_InstallationItems.AllItems,
        "Location",
        "ResultColumn"
    ),
    "<tr><td>" &Location & "</td><td>" & With(
        {
            values: Split(
                Concat(
                    ResultColumn,
                    Item & ";"
                ),
                ";"
            )
        },
        Concat(
            FirstN(
                values,
                CountRows(values)-1
            ),
            Result & ";" & "<br>"
        )
    )
) & "</td></tr>" & "</tbody></table>"

 

View solution in original post

3 REPLIES 3
gabibalaban
Super User II
Super User II

@SukhRehal ,

Try this one:

 

"<table border='1' width='100%'>" & "<thead><tr><th>Location</th><th>Items</th></thead>" & "<tbody>" & Concat(
    GroupBy(
        gal_InstallationItems.AllItems,
        "Location",
        "Result"
    ),
    "<tr><td>" & Location & "</td><td>" & Concat(
        Result,
        Item & ";" & "<br>"
    ) & "</td></tr>"
) & "</tbody></table>"

 

Hope it helps ! 

SukhRehal
Regular Visitor

Thank you, 

 

it does work to an extent, it groups the "Location" column as I wanted it to but it doesn't show the Items in the "Items" column on separate lines it's not replacing the ";" with <br/>.

"<table border='1' width='100%'>" & "<thead><tr><th>Location</th><th>Items</th></thead>" & "<tbody>" & Concat(
    GroupBy(
        gal_InstallationItems.AllItems,
        "Location",
        "Result"
    ),
    "<tr><td>" & Location & "</td><td>" & Concat(
        Result,
        Item & ";" & "<br>"
    ) & "</td></tr>"
) & "</tbody></table>"

 

@SukhRehal ,

What about this ?

 

"<table border='1' width='100%'>" & "<thead><tr><th>Location</th><th>Items</th></thead>" & "<tbody>" & Concat(
    GroupBy(
        gal_InstallationItems.AllItems,
        "Location",
        "ResultColumn"
    ),
    "<tr><td>" &Location & "</td><td>" & With(
        {
            values: Split(
                Concat(
                    ResultColumn,
                    Item & ";"
                ),
                ";"
            )
        },
        Concat(
            FirstN(
                values,
                CountRows(values)-1
            ),
            Result & ";" & "<br>"
        )
    )
) & "</td></tr>" & "</tbody></table>"

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,203)