Percentage Between two Diff Aggregates

I want to find the percentage between counts of two different Aggregates 


I tried alot but it didnt work 

Anyone can help?

Solution

Hi Faisal,


It depends if you're working on a traditional or reactive.

If you are working on traditional, you should:

  1. Create a local variable of type integer or decimal
  2. Do an assign after queries on preparation (or on the screen action you do the queries) and assign one count dividing by the other to that variable.

If you are on reactive.

You should:

  1. Choose one aggregate to be the first (let's called it #1)
  2. Create an On AfterFetch to that aggregate
  3. On the after fetch call refresh of the query #2
  4. Create an output of type integer or decimal on the after fetch
  5. Do an assign and assign one count dividing by the other to that variable.

Cheers,

João

Solution

Hai  Faisal Waheed 

This Sql but This Formula 


Select Grade, (Count(Grade)* 100 / (Select Count(*) From MyTable)) as Score
From MyTable
Group By Grade

Selva bharath wrote:

Hai  Faisal Waheed 

This Sql but This Formula 


Select Grade, (Count(Grade)* 100 / (Select Count(*) From MyTable)) as Score
From MyTable
Group By Grade

 Hi Selva,

I need a query to solve the following:

select  count(grade with where condition) /  count(total grade) *100

group by Grade