Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repeat Field Value

Status
Not open for further replies.

esings2him

Programmer
Nov 12, 2010
21
US
Hi! I've been having trouble getting a field value to repeat so I can group on it and use it as a parameter. What I would like to see is the sales order number repeated as shown below.

SO# Sales Job Parent/Child Jobs TargetJobNum
0000093 WXYZ-0000093_1 001012 WXYZ-0000093_1
0000093 WXYZ-0000093_1 001012-XM502 001012
0000093 WXYZ-0000093_1 001012-RM208 001012
0000093 WXYZ-0000093_1 001012-WM207 001012
0000093 WXYZ-0000093_1 001012-YM210 001012

Currently, I'm getting these results:
SO# Sales Job Parent/Child Jobs TargetJobNum
0000093WXYZ-0000093_1 001012 WXYZ-0000093_1
WXYZ-0000093_1 001012-XM502 001012
WXYZ-0000093_1 001012-RM208 001012
WXYZ-0000093_1 001012-WM207 001012
WXYZ-0000093_1 001012-YM210 001012

Here's my formula for the SO#:
If Length ({Table.TargetJobNum}) > 6 then
Mid ({Table.TargetJobNum}, 6, 7)

I've created a RT and it gives me the results I want, but I can't group on it or use it as a parameter. What else would give the results I'm looking for?


 
Looks like you have set formatted the SO# field to suppress if duplicated. Right click field-> format field -> common tab -> uncheck suppress if duplicated

Ian
 
Why not use:

If Length ({Table.SalesJob}) > 6 then
Mid ({Table.SalesJob}, 6, 7)

-LB
 
Ian- That is incorrect; I don't have the suppress if duplicated checked; the data doesn't duplicate because the values aren't true for the If statement.

lbass-Your formula worked perfect, exactly like I wanted, but I can't group on it or add it as a parameter because the Table.SalesJob is a formula and not a Table.Field. Is there another way around this?
 
@SalesJob contents:

If maximum({Table.TargetJobNum},{@Job Nums 2}) < '6'
then ""
else maximum({Table.TargetJobNum},{@Job Nums 2})

@Job Nums 2 contents:
If instr({Table.JobNum}, "-") =0 then {Table.JobNum} else
split({Table.JobNum}, "-")[1]

@JobNums2 formula is what I'm grouping on to get all of the jobs together.
 
The solution is the same as in your last posted thread
thread767-1643737--to use a SQL expression. What happened when you tried that?

-LB
 
I didn't try that; I figured out a different solution. I will try the sql expression and let you know how that goes. Thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top