Forum

Retaining an unrela...
 
Notifications
Clear all

Retaining an unrelated column in a Group By

2 Posts
2 Users
0 Reactions
273 Views
(@njmom)
Posts: 1
New Member
Topic starter
 

Four Columns: 

Order Number

Item Cost

Item Name

Item Description

 

I want to find the item with the minimum cost in each order. So I am doing a group by on Order Number with Item Cost set to minimum. However, I need the associated Item Name and the associated Item Description retained in my table. 

 

How would I do that?

 
Posted : 21/05/2017 6:54 am
(@catalinb)
Posts: 1937
Member Admin
 

Hi Janice,

Add 2 more columns in the Group By section: the Item Name and Description.

You can an add more steps after grouping: sort the results after item Cost, (smallest to Largest), then Keep rows - Top 1 Rows, in case you have multiple results.

Catalin

 
Posted : 21/05/2017 8:04 am
Share: