Avatar

Level 4

Hello @Mrityunjay

 

I have explained you two case in my last reply. 

You can use the second solution to do the sum of all orders and group by customer Id .

It start form the line "If you want to target, if total amount of all orders >5000 then you need to use group by. " from above reply. 

 

There i mentioned "sum(@amount*@orderquantity)", if you have total amount then you can do the sum of totoalAmount like sum(@totalAmount)

 

Thanks.

Parvesh.