For example, ARIBH.IDINV is a string. We manually enter alphanumeric document number like SI-0001, SI-0002 ... . Can you also identify missing series here?
Do the strings always start with the same two letters or can there be various letters? Would you need to determine whether there were missing letter combinations? Or only missing numbers within strings starting with specific letters?
You can easily remove the letters and then identify missing numbers. If you want more help on this, you should provide an example that includes all variations and also show the expected results for that example.
I need to see the missing numbers of the alpha numeric series. Document number differs every branch so it can be various letters and numbers. There can be 2 to 4 letters separated by 4 to 6 numbers.
You could insert a group on this formula {@letterID}:
stringvar array z := split({table.ID},"-");
z[1]
Then sort on a second formula {@valID}:
stringvar array z := split({table.ID},"-");
val(z[2])
Then use the earlier method to create a formula that fills missing values and format it to can grow:
whileprintingrecords;
stringvar array z := split({table.ID},"-");
numbervar array x;
redim x[1];
numbervar diff := 0;
numbervar i;
stringvar y := "";
numbervar w := len(z[2]);
if not onlastrecord and
{@valID}<>next({@valID})-1 then (
diff := next({@valID})-{@valID};
for i := 1 to diff -1 do (
redim preserve x;
x:={@valID}+i;
if i=diff-1 then
exit for
));
for i := 1 to ubound(x) do(
if onlastrecord or
{@valID}=next({@valID})-1 then
y := totext(x,0,"") else
y := y + {@letterID}+"-"+replicatestring("0",w-len(totext({@valID},0,"")))+totext(x,0,"")+chr(13);
);
I actually meant 1000 -- that's the limit. It would surprise me if you had gaps that large, so that made me wonder if you had used the formula exactly as shown.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.