Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    custom line count (field = last field + 1) doesn't work in Data Mig ?
Go
New
Search
Notify
Tools
Reply
  
custom line count (field = last field + 1) doesn't work in Data Mig ?
 Login/Join
 
Silver Member
posted
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)
ELSE 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
 
Posts: 46 | Registered: September 22, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Reply With QuoteReport This Post
Master
posted Hide Post
quote:
The LAST function really applies to the internal matrix in TABLE requests only.


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.
 
Posts: 908 | Location: Oklahoma City | Registered: October 27, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
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
Windows
 
Posts: 126 | Registered: January 18, 2007Reply With QuoteReport This Post
Guru
posted Hide Post
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.
 
Posts: 380 | Location: New York City | Registered: May 03, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    custom line count (field = last field + 1) doesn't work in Data Mig ?

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.