COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Framework Manager => Topic started by: lynnlls on 06 Oct 2009 08:29:03 PM

Title: How to strip the integer value from item code
Post by: lynnlls on 06 Oct 2009 08:29:03 PM
I created an embedded calculation in Framework Manager as query item named length which calculate the unit weight for the item.

Example:
Item code: 01508-AT5-F30H15-6100

(substring(trim(both,[Item Inventory by Warehouse].[Warehouse Items].[Item]), 18,4))

Result: 6100 (data type->char)

May i know how to get the last 4 characters of the item code which strip it from right (by default is left) then convert it into integer value?

Thanks & Regards,
Lynn  :)
Title: Re: How to strip the integer value from item code
Post by: Naven on 07 Oct 2009 06:01:26 AM
Hi,

substr([Item Inventory by Warehouse].[Warehouse Items].[Item],-4)

Regards
Naveen