cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

6 formulas that retrieve the correct data from the data base, however it places spaces between the differing values as well a 6 values aren't printing on the same line. As you can see in the image that is attached there are blank lines that wont allow the all the formulas to be printed on the same line. The formulas are located within the details sections. The more formulas I have the more spaces are added. Any way to have all formulas functioning on the same line?

0 Likes
View Entire Topic
Former Member
0 Likes

@ final

if ({RESULTS.TESTNO}='Liquid Reconciliation' or {RESULTS.TESTNO}='Reconciliation') and {RESULTS.ANALYTE}='Final Gross Weight'

then tonumber({RESULTS.FINAL})

@empty

if ({RESULTS.TESTNO}='Liquid Reconciliation' or {RESULTS.TESTNO}='Reconciliation') and {RESULTS.ANALYTE} like 'Empty*'

then {RESULTS.FINAL}

The empty calculation doesn't have tonumber bc it throws an error stating non-numerical

abhilash_kumar
Active Contributor
0 Likes

Hi Travis,

Looks like the {RESULTS.FINAL} field contains characters as well. Modify the @empty formula to:

if ({RESULTS.TESTNO}='Liquid Reconciliation' or {RESULTS.TESTNO}='Reconciliation') and {RESULTS.ANALYTE} like 'Empty*'

then

(

     local stringvar temp := {RESULTS.FINAL};

     local stringvar Empty;

     local numbervar i;

     for i := 1 to len(temp) do

     (

         if temp[i] IN ["0" to "9"] then

        Empty := Empty + temp[i];

     );

ToNumber(Empty);

)

You should now be able to do final-empty as suggested in my previous reply.

-Abhilash

Former Member
0 Likes

Doing what you mentioned above to empty, throws an error saying non-numerical, and highlights

tonumber(Empty) the last statement in the calculation

abhilash_kumar
Active Contributor
0 Likes

OK. Could you create another formula with the code below and place it beside the original formula:

IF IsNumeric({RESULTS.FINAL}) then

"Numbers"

else

"Strings"

What does the formula return?

P.S: Does the {RESULTS.FINAL} contain NULL values by any chance? In which case you can also select 'Default Values for Null' from the Drop-down on the top in the Formula Editor Window for the @Empty formula.

-Abhilash

Former Member
0 Likes

It returns NUMBERS. No the final should never have a null value.

so the formaula that is have an issue is: It says the empty needs to be a number, then I say tonumber then it says non numerical.

numbervar final;
numbervar empty;

final:= Maximum({@final gross wt.});
empty:=Maximum({@empty wt.});

final-empty;

abhilash_kumar
Active Contributor
0 Likes

Could you attach the report with saved data please? To attach the report change its extension from .rpt to .txt and click the 'use advanced editor' link in the report window.

Make sure you commend the piece of the code in the formula that throws the error before saving the report.

-Abhilash

Former Member
0 Likes

Sorry, for the delay. I was out of town. Where is the Use Advance Edit at?

abhilash_kumar
Active Contributor
0 Likes

Sorry for the confusion. I should've said:

"To attach the report change its extension from .rpt to .txt and click the 'use advanced editor' link in the report reply window (Here in SCN)."

-Abhilash

Former Member
0 Likes

I do not have a "use advance editor" link in reply window. I can only attach a link or photo.