Lookup Results

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Lookup Results

Post by Raftsman »

When a reference record is not found during the lookup for a VarChar record it returns ''. It there a way to change the '' to ~. I am using the INDEX function. INDEX('ALPS', expression, 1). the problem is '' returns 1 from the INDEX call. Not sure why but in order for my INDEX to work, I need to convert the ''.

Thanks in advance
Jim Stewart
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why not just if-then-else around the index function?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

I was trying to shorten the statement. I thought I could use the following

INDEX('ALPS',function(expression,'','~'),1)

My IF statement already is complex.
Jim Stewart
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Perhaps something like?

INDEX('ALPS', (if expression = '' then '~' else expression),1)
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply