25
Views
12
Solved
How to get record Percentage using Aggregate based on dropdown change
Question
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

 A B C Order Approved Approved By: No Yes Mana Yes Yes Auto 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

Champion

Hey,

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

 Supplier Match Approved Approved By: Supplier 1 No Yes Mana Supplier 1 Yes Yes Auto Supplier 1 Yes Yes Auto Supplier 1 Yes Yes Auto Supplier 2 Yes Yes Auto Supplier 2 Yes Yes Auto Supplier 2 Yes Auto Supplier 2 Yes Auto Supplier 2 Yes Auto Supplier 3 No Supplier 3 Yes Supplier 3 No Supplier 3 No Supplier 3 Yes Supplier 3 Yes Supplier 4 No Yes Supplier 4 Yes Yes Supplier 4 No Yes Supplier 5 Yes Yes Supplier 6 Yes Yes

Have you tried my solution?

Thanks & Regards,

Sudip Pal

Champion

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

Thanks its works

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