Skip to main content
Solved

Custom SQL Query using LIKE


I need to make a field transformation such that if the field value starts with “DOK”, then I want to replace the value with “1001”. I tried to set up this custom field transformation using something along the lines of CASE WHEN …, but didn’t manage to get this to work. How would I write this code in TX?

Best answer by rory.smith

Hi @Vojtech Kurfurst ,

 

the best way to implement IF-THEN-ELSE constructions is by using Fixed transformations and conditions:

In this example TimeXtender will load the Description from the ODX and only replace with 1001 if the Descriptions starts with DOK . The basic approach is to have Data Movement or Fixed Transformation as the default (the ELSE) and then add transformations with conditions (IF THEN) for all the cases you want to support. There is no break statement, so all transformations fall through. This means your conditions should lead to disjunct cases, or you need to depend on the ordering of the transformations (most specific case last).

View original
Did this topic help you find an answer to your question?

rory.smith
TimeXtender Xpert
Forum|alt.badge.img+7
  • TimeXtender Xpert
  • July 13, 2023

Hi @Vojtech Kurfurst ,

 

the best way to implement IF-THEN-ELSE constructions is by using Fixed transformations and conditions:

In this example TimeXtender will load the Description from the ODX and only replace with 1001 if the Descriptions starts with DOK . The basic approach is to have Data Movement or Fixed Transformation as the default (the ELSE) and then add transformations with conditions (IF THEN) for all the cases you want to support. There is no break statement, so all transformations fall through. This means your conditions should lead to disjunct cases, or you need to depend on the ordering of the transformations (most specific case last).


Perfect, worked like a charm. Thanks!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings