cancel
Showing results for 
Search instead for 
Did you mean: 

Running Total Issue

Former Member
0 Kudos

Good Day to All,

Hopefully I can explain this so that I get a good result.

In the Running Total Dialogue box here are my entries.

Running Total Name is PriorBalance

The field that I am summarizing is @Prior and the type is SUM

and I'm Evaluateing on a group called @TranGroup-A and resetting on a change of group called ChargeType.

This is working as excepted.

My question is there a way to Evaluate on 2 criterias ?

I want to evaluate on @TranGroup and use a formula where @Prior is less than zero "{@Prior} < 0"

Or can a formula be written where it evaluates  when

{@Prior} < 0 and @TranGroup   --I get an error when AI try this.

Kind Regards,

David

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Abhilash, But for some reason I can't attached a file.

abhilash_kumar
Active Contributor
0 Kudos

Hi David,

Shouldn't that Evaluate condition be:

if {@Prior} < 0 and @TranGroup then True

If this doesn't work, then create a Manual Running Total.

- Abhilash

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces


Former Member
0 Kudos

I get an error when I try this   -- A Boolean is required here.

if {@Prior} < 0 and {@TranGroup}then True

I will try to build a Manual Running Total. Never did this before.

Thanks.

Former Member
0 Kudos

Hi David,

Try this formula

if {@Prior}<0 then

(             if {@TranGroup} then True

)

else false

- Nrupal

Former Member
0 Kudos

Tried the formula I still get A Boolean is required here. error

abhilash_kumar
Active Contributor
0 Kudos

Yes, that's because it expects something like this:

if {@Prior} < 0 and {@TranGroup} = some value then True

You would need a Manual Running total I guess.

-Abhilash

Former Member
0 Kudos

Good Day Abhilash,

I created a manual running total with 3 variables.

I put the reset in the group header

the running total in the detail

and the display in the group footer.

My question is how do i get it to evaluate on @Prior < 0 and @Trangroup

Reset

WhilePrintingRecords;

CurrencyVar Amount := 0;

RunningTotal

whilePrintingRecords;

CurrencyVar Amount;

Amount := Amount + {@Prior};

Display

WhilePrintingRecords;

CurrencyVar Amount;

abhilash_kumar
Active Contributor
0 Kudos

Hi David,

What is @TranGroup? I understand its a group, but do you want the Running Total to evaluate when the value of @TranGroup is a certain value?

The formulas you've created above the correct but I'm clueless as to what the issue is.

This Running Total will evaluate for every '@Trangroup' group when the prior value is less than zero.

Could you explain the issue a little more, perhaps a screenshot would be good too.

-Abhilash

Former Member
0 Kudos

Good Day Abhilash,

Here is a screen shot of what @TranGroup is. To tell the truth this report was given to me to create a summary.

The Second screen shot is a running total that works and gives excepted output. As you can see the running total

evaluates on a Group called @TranGroup and Resets on ChargeType.

Now I need to create two running totals one for all Prepaids and Delinquent.

Hence I need to check if @prior > 0 and @Trangroup. then I need to create another running total where @prior < 0 and @Trangroup.

The great than zero is the delinquent and the less than zero is prepaids. Combined they should equal my total @prior, since total @prior is made up of delinquent and prepaids. So basically @prior has two subsets >0 and <0 but they both have Evalute on change of group of @Trangroup.

I hope this works.

Thank

David

abhilash_kumar
Active Contributor
0 Kudos

Hi David,

I don't understand this part: "Hence I need to check if @prior > 0 and @Trangroup"

I understand @prior > 0, but what is @Trangroup? Do you mean to evaluate it when prior is greater than zero and the value of Trangroup is some value?

How would the plain english translation be like?

-Abhilash

Former Member
0 Kudos

Abhilash,

@Prior is a forumla that checks for 0 and blank values.

ex.

if isnull({Command.priorch}) then 0 else

if trim({Command.priorch}) = "" then 0 else tonumber({Command.priorch})

now I have to to a summary on this field @prior take a look at the screen shot from previous thread.

the fields is @prior type of summary is sum, Evalute on change of group which is @TranGroup

and reset on change of group Chargetype.

Now @trangroup is a formula that reads as follow.

{Command.pscode}+{Command.tscode}+{Command.status}+{Command.tranNo}+{Command.dhmy}+{Command.chargetype}+{Command.sNotes}+{Command.trhmy} I know this is where the confusion begins. I don't know why it works but it does.

My running Total #PriorBalance works and I get the correct excepted output. This is a combination of @Prior > 0 and @Prior < 0.

What I need to do is create two buckets for delinquent and prepaids from @Prior this is why I need @Prior < 0 and another for @Prior > 0 .

My problem is that I can't do both at evalute change I can't check to see if  < 0 or > 0 and change on @Trangroup

If there is more information please let me know.

Kind Regards,

David

abhilash_kumar
Active Contributor
0 Kudos

Hi David,

How about you create two variables and evaluate them:

whileprintingrecords;

currencyvar del;

currencyvar pre;

if isnull({Command.priorch}) then 0 else

if trim({Command.priorch}) = "" then 0 else

if tonumber({Command.priorch}) < 0 then

(

     del := del + {Command.priorch};

     {Command.priorch}

)

else if tonumber({Command.priorch}) > 0 then

(

     pre := pre + {Command.priorch};

     {Command.priorch}

);

Then add these variables in the reset formula too.

-Abhilash

Former Member
0 Kudos

I create this formula and get an error

whileprintingrecords;
currencyvar del;
currencyvar pre;
if isnull({Command.priorch}) then 0 else
if trim({Command.priorch}) = "" then 0 else tonumber({Command.priorch})

(
   del := del + {Command.priorch};
   {Command.priorch}
)
   else if tonumber({Command.priorch}) > 0 then

(
   pre := pre + {Command.priorch};
   {Command.priorch}
);

the remaining text does not appear to be part of the formula

abhilash_kumar
Active Contributor
0 Kudos

Hi David,

The formula is:

whileprintingrecords;

currencyvar del;

currencyvar pre;

if isnull({Command.priorch}) then 0 else

if trim({Command.priorch}) = "" then 0 else

if tonumber({Command.priorch}) < 0 then //You're missing this part here

(

     del := del + {Command.priorch};

     {Command.priorch}

)

else if tonumber({Command.priorch}) > 0 then

(

     pre := pre + {Command.priorch};

     {Command.priorch}

);

Former Member
0 Kudos

command.priorch is a string field. the formula is giving me a A number s required here.

if tonumber({Command.priorch}) < 0

abhilash_kumar
Active Contributor
0 Kudos

Alright it should be:

whileprintingrecords;

currencyvar del;

currencyvar pre;

if isnull({Command.priorch}) then 0 else

if trim({Command.priorch}) = "" then 0 else

if tonumber({Command.priorch}) < 0 then //You're missing this part here

(

     del := del + tonumber({Command.priorch});

     tonumber({Command.priorch});

)

else if tonumber({Command.priorch}) > 0 then

(

     pre := pre + tonumber({Command.priorch});

     tonumber({Command.priorch});

);

Former Member
0 Kudos

OK the formula work now what? how do I use these variables to create a running total.

abhilash_kumar
Active Contributor
0 Kudos

Hi David,

Now create two separate variables to show the delinquent and prepaid totals.

@Display_Delinquent: Place this on the Group Footer

whileprintingrecords;

currencyvar del;

@Display_Prepaids:

whileprintingrecords;

currencyvar pre;

-Abhilash


Former Member
0 Kudos

Both displays have 0.00 which is incorrect.

abhilash_kumar
Active Contributor
0 Kudos

Hi David,

Would you be able to attach the report with saved data please?

To be able to attach the report, you would first need to change its extension to .txt.

-Abhilash