cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Marya_rybalka
New Member

SQL Get Rows (V2) Aggregate Group by Issue

I want to retrieve a count of customers, grouped by a record status of "bad" or "incomplete" using the SQL Get Rows (V2) Connector. I'm able to retrieve the rows of customers with their affiliated record status, but can't get the count/group by aspect to work. Does anyone know how to do this? Any help would be greatly appreciated! More info below. 

Under the "Aggregation transformation" field, I have tried: 

  • groupby((recordstatus),aggregate(person_id)) 
  • $count(person_id) 

My filter query (which works):

  • recordstatus eq 'bad' or recordstatus eq 'incomplete' and statuscode eq 0 
    • Note: the status code filters out inactive customers

Here is the SQL query: 
Select count(person_id), recordstatus from dbo.Customer
where record status IN ('bad', 'incomplete') and statuscode = 0 
group by (person_id);

0 REPLIES 0

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,509)