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

Combine Duplicate items in colum

I have a simple shopping cart collection with itemName and quantity. I would like to combine duplicate entries of an item and add up the number of the quantity. How can I achive this?

 

ItemQty
Laminating Pouches1
Laminating Pouches1
Laminating Pouches1
Laminating Pouches1
Laminating Pouches1

 

to 

 

ItemQty
Laminating Pouches5
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

I haven't don't much with it but I think this example can get you there. 

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby

 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

3 REPLIES 3
Super User
Super User

I haven't don't much with it but I think this example can get you there. 

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-groupby

 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training

View solution in original post

Omg! Shane from BoldZebra!?

 

I'm so honored! Big fan of your tutorials by the way. 

It got it to work by grouping and creating 3 diffrent collections, from wich I did the sum of items on the last collection.

 

A Button preforms the following from the existing collection "ShoppingCart"

 

ClearCollect(ItemsByDes, GroupBy(ShoppingCart, "item", "qtys"));ClearCollect(ItemCount, AddColumns(ItemsByDes, "total of item", Sum(qtys, qty)))

 

Thanks for the reference!

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.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (39,307)