I'm looking for a way to create a line (within invoice) counter and using a way that works in webFOCUS.
In my transformation, I have the following code for an integer field called LINE_KEY:
IF (HEADER_KEY EQ LAST HEADER_KEY)
THEN (LAST LINE_KEY + 1)
In the expression calculator is says the expression is valid. If I check the sample data within the calculator it says it cannot find field named LINE_KEY.
Is there another way to achieve this?
I am using DM iway server 7.6.10 on windows server 2003.
wf 767 running on w2k3 srvr
The LAST function really applies to the internal matrix in TABLE requests only. SQL does not recognize it; MODIFY inactivates work area field values after a record is added/updated/deleted, so values from previous records would not be available during processing for the current record. (MODIFY does provide a means for preserving values from the previous record, but this functionality is not part of DataMigrator.) You could try creating a new column in the "Select Columns" section (although the data will need to be sorted correctly) or you may need to create a preprocessing step prior to the Data Flow.
I'm positive that is incorrect. If I have pre-sorted data (i.e. temp file that Oracle has already sorted), LAST works just fine with TABLEF and TABLEF does not use the internal matrix.
I don't use Data Migrator, but normal FOCUS syntax would have a ";" after the ELSE 1.
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Can you go into the text view of the data flow and send us the code?
Data Migrator 5.3, 7.1, 7.6
WebFOCUS 7.1, 7.6, 7.7
SQL Server, Oracle, DB2
I think you've got one too many LAST there. Please try:
LINE_KEY / I5 =
IF (HEADER_KEY EQ LAST HEADER_KEY) THEN LINE_KEY + 1 ELSE 1
Note that while numeric columns are self-initialized as zero the validate syntax check doesn't know that so it won't pass a syntax check but it will still work.
|Powered by Social Strata|