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

Nested functions syntax help

Hi everyone.  Need help with nested functions.  When I pull in a gallery using the following formula:

Sort(GroupBy(DepotPlacedOrders,"Part","DATA"),Part,Ascending)

 

I get exactly what I need.  I am trying to turn it into a collection and add date pickers.  When I use this formula

ClearCollect(colRollup,Filter(Sort(GroupBy(DepotPlacedOrders,"Part","Created","DATA"),Part,Ascending),(Created>=dpStartRollup.SelectedDate Or IsBlank(dpStartRollup.SelectedDate)) And (Created<=DateAdd(dpStopRollup.SelectedDate,1,Days) Or IsBlank(dpStopRollup.SelectedDate))))

 

Its ALMOST perfect, it just does not group by the column "Part" .  Everything else appears to work correctly.  The date picker works properly.

 

Any help would be appreciated!  

 

Chris

1 ACCEPTED SOLUTION

Accepted Solutions

@ckserra 

Please try the following. Items Sold will have the count you need.

 

ClearCollect(
  colRollup,
	AddColumns(
		GroupBy(
			Sort(
				Filter(
					DepotPlacedOrders,
					(
					  Created >= dpStartRollup.SelectedDate 
					  Or IsBlank(dpStartRollup.SelectedDate)
					) 
					And (
					  Created <= DateAdd(
						dpStopRollup.SelectedDate, 1, Days
					  ) 
					  Or IsBlank(dpStopRollup.SelectedDate)
					)
				),
				Part, Ascending
			), 
			"Part", "DATA"
		),
		"Items Sold", CountRows(DATA)
	)
)

View solution in original post

5 REPLIES 5
CNT
Super User
Super User

@ckserra 

Please try the following,

ClearCollect(
  colRollup,
    GroupBy(
		Sort(
			Filter(
				DepotPlacedOrders,
				(
				  Created >= dpStartRollup.SelectedDate 
				  Or IsBlank(dpStartRollup.SelectedDate)
				) 
				And (
				  Created <= DateAdd(
					dpStopRollup.SelectedDate, 1, Days
				  ) 
				  Or IsBlank(dpStopRollup.SelectedDate)
				)
			),
			Part, Ascending
		), 
		"Part", "Created", 
        "DATA"
    ) 
)

@CNT Thank you for the quick reply.  I am seeing the same thing on the gallery with this code.  Its repeating items in the parts column still.  

 

ckserra_0-1638371078773.png

Ultimately Im trying to get the number of items sold for each item in the parts column.

Chris

@ckserra 

Please try the following. Items Sold will have the count you need.

 

ClearCollect(
  colRollup,
	AddColumns(
		GroupBy(
			Sort(
				Filter(
					DepotPlacedOrders,
					(
					  Created >= dpStartRollup.SelectedDate 
					  Or IsBlank(dpStartRollup.SelectedDate)
					) 
					And (
					  Created <= DateAdd(
						dpStopRollup.SelectedDate, 1, Days
					  ) 
					  Or IsBlank(dpStopRollup.SelectedDate)
					)
				),
				Part, Ascending
			), 
			"Part", "DATA"
		),
		"Items Sold", CountRows(DATA)
	)
)

View solution in original post

@CNT That works perfect, thank you very much for your help!!

 

Chris

@ckserra 

Glad to help!

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,452)