Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

help with the following formula

i have this formula

if({Command.Job Requested}<> 0) then

if ({Command.GetWeekNo} = {?WeekNo} and {Command.GetYearNo} = {?YearNo}) then

count({Command.CompleteByDate},{Command.SectionDescription}) / sum({Command.Job Requested}, {Command.SectionDescription})

else 0

else 0

it's suppose to count all records where WeekNo and YearNo the user selects and divide with sum of everything in the database.

what i'm trying to get here is the percentage of what was done in the week the user select

replied

Hi Nomvula,

In your current formula it will get the sum for a particular weekno and yearno.

do the following to get the required results :

Create a formula1 :

sum({Command.Job Requested}, {Command.SectionDescription})

Create a formula2 :

if({Command.Job Requested} 0) then

if ({Command.GetWeekNo} = {?WeekNo} and {Command.GetYearNo} = {?YearNo}) then

count({Command.CompleteByDate},{Command.SectionDescription}) / formula1

else 0

else 0

In formula1 it will get the database sum and in second formula the count will be divided by this database sum.

Thanks,

Sastry

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question