Newbie question on transform decode

4 views
Skip to first unread message

Torsten Becker

unread,
Jun 2, 2009, 7:38:05 AM6/2/09
to activewareh...@googlegroups.com
Thanks for the great tool of activewarehouse and its functionality!

I have started some experiments and can get the first cube to work.

I have run into a few limited problems, one of which is that I cannot
get the transform decode to work. I have created a file decode.txt and
it is coded with the ":" as a separator. All values (four digit
numbers) have a value associated with the code.

If I run the ctl file using the decode transform, the result is "No
value", which comes from the decode default values. Without the line,
the four digit number is stored in the column.

Here are some code excerpts:

in .ctl:
transform :material_type, :decode, {:decode_table_path => 'data/
decode.txt'}

Exerpt from decode.txt:
7955:TradedGoods
7960:Other
7966:Other
:NoMT

What do I need to change? Any hints?

Thanks in advance,

Torsten

Thibaut Barrère

unread,
Jun 2, 2009, 7:41:52 AM6/2/09
to activewareh...@googlegroups.com
What do I need to change? Any hints?

If the material_type field is an integer, the decode might not be able to decode it (might expect a string).

I'd recommend to unpack the activewarehouse-etl gem and have a look at the source to be sure.

A quick hint - sorry I haven't got more time right now!

HTH,

-- Thibaut
 


Thanks in advance,

Torsten




Torsten Becker

unread,
Jun 2, 2009, 7:48:45 AM6/2/09
to activewareh...@googlegroups.com
Thibaut,

thanks for the quick reply.

The material_type is a string with length 15,

The source code review showed that the value was "No Value" as the
default value, but I could not identify where an integer is required.

Torsten
Dr. Torsten Becker
BESTgroup Consulting & Software GmbH
Kurfürstendamm 42 10719 Berlin Germany
Tel +49(0)30 2000 390-0
Fax +49(0)30 2000 390-12
Mobile +49(0)171 443 1973
www.best-group.eu




Thibaut Barrère

unread,
Jun 5, 2009, 6:32:13 PM6/5/09
to ActiveWarehouse Discuss
> The material_type is a string with length 15,

Did you try trimming the value before passing it to the transform ?
Maybe some padded blanks cause the issue.

-- Thibaut

Torsten Becker

unread,
Jun 6, 2009, 4:53:55 PM6/6/09
to activewareh...@googlegroups.com
Thibaut,

thanks for your reply. The trim options was not the problem, the
length was ok.

My problem was that the end of line needs to be CRLF as in Windows. On
Mac there is only CR so the decodetable was not build correctly.

Thanks for your help!

Torsten
Reply all
Reply to author
Forward
0 new messages