25
Views
12
Comments
Solved
How to get record Percentage using Aggregate based on dropdown change
Application Type
Reactive
Service Studio Version
11.54.25 (Build 62773)

Hi 


Here is my logic. i create to different aggregate for get each count and try to filter from source. Also tired to calculate the percentage

ABC
OrderApprovedApproved By:
NoYesMana
YesYesAuto
Yes




Logic Calculation
Total Approved %(2/3)*100
Pending Approved %(1/3)*100
Auto Approved %(1/3)*100


Attached the oml for reference


Approvedby.oml
Solution

Use the below filter in GetValues instead of the previous one.


Supplier.Supplier=Supplierlist or Supplierlist=""



Thanks & Regards,

Sudip Pal

Hey,

Your question is not clear, what you want to achieve. please explain your question.


Komal

Hi Komal Kumbhar,

i am try to calculate the Percentage of the record based. For ex:  in above table we have total 3 record in that i have 2 approved and 2 approved by auto. I need calculate % based on this 

1. pending Approval % = (1 pending / 3 total record ) *100 like this i need calculate other record also 

Hope this will help  


Hey Manavalan,

I have updated the OML based on your inputs.Please check and let me know if you want something else.

Thanks & Regards,

Sudip Pal

Approvedby.oml

Hi,

If I have understood correctly , then you have two aggregates , one of that returns the records approved by Auto and another which returns approved by Mana. Is my understanding correct ?

Or If this is not correct please tell us what the aggregates return ? You can simply filter by Approved and Approved By column to get your desired result. 

Hi @Suprio Roy ,

Thanks for the response. I have only one aggregate table like below. I have one drop down in the page supplier. i need to get % of following

1. First time in page load need % of Total Approved, Pending Approved, Auto Approved

2.  If user click dropdown and filter by supplier for EX: If i filter supplier 1 , i need % of % of Total Approved, Pending Approved, Auto Approved 

Hope it will clear 

SupplierMatchApprovedApproved By:
Supplier 1NoYesMana
Supplier 1YesYesAuto
Supplier 1YesYesAuto
Supplier 1YesYesAuto
Supplier 2YesYesAuto
Supplier 2YesYesAuto
Supplier 2Yes
Auto
Supplier 2Yes
Auto
Supplier 2Yes
Auto
Supplier 3No

Supplier 3Yes

Supplier 3No

Supplier 3No

Supplier 3Yes

Supplier 3Yes

Supplier 4NoYes
Supplier 4YesYes
Supplier 4NoYes
Supplier 5YesYes
Supplier 6YesYes


Have you tried my solution?

Thanks & Regards,

Sudip Pal


Sudips solution works with pagination. If you do not have pagination you can easily calculate the percentages in an OnAfterResponse action. Just have 3 calculations, one for each state and you have what you need. 

But again, Sudip solution is more robust. Use that one.

Hi Sudip ,


Thanks for the reply. In above your solution working only on change drop down. Not in first time load 

So, on the first-time scenario what should be the desired outcome?

Thanks ,

Sudip Pal

Hi Supia,


Need to Show % of all Supplier  Total Approved, Pending Approved, Auto Approved Ex:

 Total record 12 

In approval 4

Need to show Total approval =(4/12)*100 =33% 

Solution

Use the below filter in GetValues instead of the previous one.


Supplier.Supplier=Supplierlist or Supplierlist=""



Thanks & Regards,

Sudip Pal

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.