Hi I have question with function "left"..
here is my function "left" using with series7 Cognos Query, how should I write this one in report studio.
Left function is not working in Report studio. please anyone have any idea??
if ( left([Available Tables].[Product Codes].[product], 1 ) = '9' ) then (decode( [Available Tables].[Product Codes].[AAA] , '9505' , 'Y','9519','Y', 'N' )) else ( 'N' )
Hi,
Try using substring.
I did try with substring but "N' value did not change to 'Y'
Your left function is correct. Check your condition - decode function (Oracle?)
Quote from: d.laxmi on 23 May 2011 10:28:25 AM
Hi I have question with function "left"..
here is my function "left" using with series7 Cognos Query, how should I write this one in report studio.
Left function is not working in Report studio. please anyone have any idea??
if ( left([Available Tables].[Product Codes].[product], 1 ) = '9' ) then (decode( [Available Tables].[Product Codes].[AAA] , '9505' , 'Y','9519','Y', 'N' )) else ( 'N' )
Cognos has perfectly good alternatives for RDBMS functions: use substring combined with a CASE construction:
CASE
WHEN
sustring([Available Tables].[Product Codes].[product], 1,1) = '9'
THEN
(CASE
WHEN
[Available Tables].[Product Codes].[AAA] = '9505' THEN 'Y'
WHEN
[Available Tables].[Product Codes].[AAA] = '9519' THEN 'Y'
ELSE 'N'
END)
ELSE 'N'
END