If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to use function "Left" in report studio..

Started by jd, 23 May 2011 10:28:25 AM

Previous topic - Next topic

jd

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'  )

kattaviz

thanks & regards
Satish Katta

jd

I did try with substring but "N' value did not change to 'Y'

tosravan

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'  )

blom0344

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