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

Need to capture value in a variable

Started by kumar_s, 16 Jul 2009 01:51:31 PM

Previous topic - Next topic

kumar_s

I have a variable ‘emp_name’, dynamic in length, which has the the employee’s name in the last, first format separated by a comma.  What I want to do is to get the last name into a variable. 

In SAS, I would have done

Lname=substr(emp_name,1,’,’) ;

I am not really sure how I’d do this using COGNOS BI and would appreciate any help I can get.

Sridevi

Try this....

substring(emp_name,1,position(',',emp_name))

Thanks,
Sridevi

Gopinath

Create a dataitem with the expression that Sridevi posted but add -1 to get rid of the comma (,) at the end

substring(emp_name,1,position(',',emp_name) -1)

kumar_s

Sridevi/Gopinath/et al:

Thank you.  You people are great!!! That worked..


Regards

Kumar