Quantcast
Channel: SCN : Unanswered Discussions - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 3719

Data Services "like" statement

$
0
0

Good day all,

 

Im looking for help or possibly suggestions. Im working in Data Services on an ETL that loads one of our custom products. In one of our files (being imported in the ETL) contains a column that is a description. This desc will either be 'Paint', 'Paint Option' or 'Paint Color'. I currently have 4 different options I am extracting all with the same naming schemes Paint, Trim and Board. So basically there are now 12 descriptions. Once I drag over my column in my schema the next step I do is perform a reverse pivot on this. Now the problem is in the pivot I can create the following:

Axis            Column

paint            paint

paint option  paintOp

Paint Color  PaintColor

Trim.....etc

 

This is all being dumping into an SQL table...so doing it this way creates 12 columns versus just the 3 I want. So here is my question. In the ETL where I first import the desciptioin column what I would like to do is this:

 

ifthenelse(file.description LIKE "Paint%", "Paint", "NA") or ifthenelse(file.description LIKE "Trim%", "Trim", "NA") or ifthenelse(file.description LIKE "Board%", "Board", "NA")

 

So when it reaches my pivot the values are just "Paint", "Board" and "Trim." Making my SQL table have only 3 columns with values versus 12 columns and plenty of Nulls. Now I have tried the match_simple under the Mapping tab...and this WORKS! Unfortunately it is only letting me specify for just ONE description

 

(ifthenelse( match_simple( Seg_UDC_Join.KWDSC1,'Paint*') = 1,'Paint','NA'))

 

and not something like this:

 

(ifthenelse( match_simple( file.description,'Paint*') = 1,'Paint','NA'))  or (ifthenelse( match_simple( file.description,'Board*') = 1,'Board','NA'))  or (ifthenelse( match_simple( file.description,'Trim*') = 1,'Trim','NA'))

 

Short of just running and update statement on the file, does anyone have any suggestions on how I can reach my goal? ANY help is appreciated!!!!


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>