on 2022 Feb 14 6:33 PM
I have a report that expects a number and dotted line to match a field called qty_required.
I created a formula field but the qty_required number can be up to 100 and I didn't want to write 100 if statements.
This is what I currently have:
if {Command.QTY_REQUIRED} = 1
then
'1. _ _ _ _ _ '
else
if {Command.QTY_REQUIRED} = 2
then
'1. _ _ _ _ _ 2. _ _ _ _ _'
else
if {Command.QTY_REQUIRED} = 3
then
'1. _ _ _ _ _ 2. _ _ _ _ _ 3. _ _ _ _ _'
else
if {Command.QTY_REQUIRED} = 4
then
'1. _ _ _ _ _ 2. _ _ _ _ _ 3. _ _ _ _ _ 4. _ _ _ _ _'
else
if {Command.QTY_REQUIRED} = 5
then
'1. _ _ _ _ _ 2. _ _ _ _ _ 3. _ _ _ _ _ 4. _ _ _ _ _ 5. _ _ _ _ _'
else
if {Command.QTY_REQUIRED} = 6
then
'1. _ _ _ _ _ 2. _ _ _ _ _ 3. _ _ _ _ _ 4. _ _ _ _ _ 5. _ _ _ _ _ 6. _ _ _ _ _'
Can you help me with getting the formula to populate in this format?
Request clarification before answering.
You could try something like this:
Local StringVar result := "";
Local NumberVar i;
For i := 1 to {Command.QTY_REQUIRED} Do
(
result := result + ToText({Command.QTY_REQUIRED}, 0, '') + '._ _ _ _ _';
)
result
This look will walk through from 1 to the number in the quantity and build the string.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oops! I forgot to add the semi-colon after the closing parenthesis. Try this:
Local StringVar result := "";
Local NumberVar i;
For i := 1 to {Command.QTY_REQUIRED} Do
(
result := result + ToText({Command.QTY_REQUIRED}, 0, '') + '._ _ _ _ _';
);
result
-Dell
User | Count |
---|---|
87 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.