cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EOCF-Pwrapp
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
Shanescows
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
Shanescows
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
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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (30,622)