en
Welcome Guest! To enable all features please Login or Register.
Options
Go to last post Go to first unread
SO  
#1 Posted : Monday, December 19, 2016 2:33:05 PM(UTC)
SO
Rank: Advanced Member

Groups: extranet\Webinar
Joined: 8/19/2014(UTC)
Posts: 105

In data modeler I have imported a crosstab as datasource an it has item description, quantity, price etc. as columns. In the "create format" in my data source in data modeler I want to add a new column which extracts or deletes a certain part of my "item description" column.

For example I want to remove the word "product" from all entries in the "item description" column. The word is always at the start of the description, so it's safe to remove the first 8 characters of the item description. The best/safest way would be to remove the word "product" and not the first 8 characters if that's possible.

I found the "replace" formula in data modeler, but didn't get it to work.

replace(&ItemDescription,1,8,"")

There is also a regexreplace() formula which maybe can do the job.

Can it be done?

Edited by user Monday, December 19, 2016 2:44:33 PM(UTC)  | Reason: Not specified

Ole  
#2 Posted : Monday, December 19, 2016 5:49:13 PM(UTC)
Ole
Rank: Administration

Groups: extranet\Webinar
Joined: 4/7/2011(UTC)
Posts: 371

From the TARGIT University course TARGIT Data Discoverer there is an example on how to work with data fields, including how to remove preceding texts from text strings.

In your case, you should try something like this:

if(left(&ItemDescription,8)="Product ", right(&ItemDesription, len(&ItemDescription)-8), &ItemDescription)

Best regards,
Ole
I work as an employee with TARGIT A/S. Any statement made by me in this forum represents my own opinion and state of mind, and is not necessarily related to or representative of TARGIT A/S.

UserPostedImage Ole Dyring
Users browsing this topic
Anonymous
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error