cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Creating Complicated collection for gallery

Hi,

 

I want to collect condensed information from a Sharepoint List. The list looks like this:

Gallery 2.PNG

I want the results of the collection to look like this:

Gallery.PNG

Detail of the columbs:

Order#- Distinct values of all Order#s

Total Quantity- Add Quantities together of like Order#

Status- Distinct value related to the Order#'s distinct value

JobNumber- Distinct value related to the Order#'s distinct value

JobName- Distinct value related to the Order#'s distinct value

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@nmoffatt 

Consider the following formula:

DropColumns(
    AddColumns(
        GroupBy(yourList,
            "Order#", "items"
        ),
        "TotalQuantity", Sum(items, Quantity),
        "Status", First(items, Status),
        "JobNumber", First(items.JobNumber),
        "JobName", First(items.JobName)
    ),
    "items"
)

That should give you what you need.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

3 REPLIES 3
Super User III
Super User III

@nmoffatt 

Consider the following formula:

DropColumns(
    AddColumns(
        GroupBy(yourList,
            "Order#", "items"
        ),
        "TotalQuantity", Sum(items, Quantity),
        "Status", First(items, Status),
        "JobNumber", First(items.JobNumber),
        "JobName", First(items.JobName)
    ),
    "items"
)

That should give you what you need.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Resident Rockstar
Resident Rockstar

Hi @nmoffatt ,

You can follow the below approach also.

See the Master Data Is Used - 

VijayTailor_1-1601581107810.png

Created the Collection - 

ClearCollect(MasterColl,Table1_2);
ClearCollect(GroupByColl,AddColumns(GroupBy(MasterColl,"Status","Order","JobNumber","JobName","ByStatus"),"TotalQuantity",CountRows(ByStatus)));

See the Result - 

VijayTailor_2-1601581220050.png


Thanks,

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."



@RandyHayes 

 

Worked perfect! Thanks

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (87,449)