Hi
I am fairly new to this report writing thing and was wondering if anyone could help...
I am trying to write a formula which will loop through all the records in the report for a
particular field (called ls_percentage) and concatenate these values into a string. If one of these
values is null I want to replace it with a value from another column (called ls_amount) in the
database but this value must belong to the same row (record) as the null value for ls_percentage.
The first problem I came across was that I was getting the right number of values but they were all
the same record. That is the first value had been repeated for the number of fields present. The
second problem is that I could not see a way of replacing one value with another value from the same
record or row (but a different column).
The formula as it stands at the moment is:
-----------------------------------------------------------------------------------
StringVar str := "";
NumberVar i:= 1;
For i:= 1 To Count ({ls.ls_percentage}) do
(
if IsNull({ls.ls_percentage}) then
str := str + "%: " + Cstr({ls.ls_percentage}) + "%" + chr(13)
else
str := str + "Amt: " + CStr({ls.ls_amount}) + chr(13)
);
str
-----------------------------------------------------------------------------------
Thanks
I am fairly new to this report writing thing and was wondering if anyone could help...
I am trying to write a formula which will loop through all the records in the report for a
particular field (called ls_percentage) and concatenate these values into a string. If one of these
values is null I want to replace it with a value from another column (called ls_amount) in the
database but this value must belong to the same row (record) as the null value for ls_percentage.
The first problem I came across was that I was getting the right number of values but they were all
the same record. That is the first value had been repeated for the number of fields present. The
second problem is that I could not see a way of replacing one value with another value from the same
record or row (but a different column).
The formula as it stands at the moment is:
-----------------------------------------------------------------------------------
StringVar str := "";
NumberVar i:= 1;
For i:= 1 To Count ({ls.ls_percentage}) do
(
if IsNull({ls.ls_percentage}) then
str := str + "%: " + Cstr({ls.ls_percentage}) + "%" + chr(13)
else
str := str + "Amt: " + CStr({ls.ls_amount}) + chr(13)
);
str
-----------------------------------------------------------------------------------
Thanks