Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a Wildmatch to link dimesion to fact table

So I have a fact table with a field called 'Policy' where the field is a nicely formatted string as seen below and I was given an excel document that needs to be added to the data set as a dimension. The only way to link the excel dimensional table to the fact table is by the 'Policy' but my issue is the Policy name is embedded in a string that is manually inputted by a user to the format of the sting is not consistent every time so I cannot simpily parse what I need out of the string and there are something around 300+ policies that I am working with so writing a huge if is out of the question.

I was trying to do a wildmatch between table 1 and table 2 to search for the value of 'Policy' field in the fact table in the values of 'Policy2' in the dim table but I cannot get that to work.

Has anyone had to do something similar to this in the past? Any help would be awesome. I have been driving myself crazy with this today.

Chris

Table #1 - Fact Table
PolicyEvent ID
PU_AL_SEP__FOUND667
PU_AL_SEP__NOT_FOUND656
567
765

   

Table #2 - Dim Table
Policy2Statusetc
123 - sdfsdfsdfsdfsd (PU_AL_SEP_FOUND)1r
1234- adasd PU_AL_SEP__NOT_FOUND2d
3s
2 Replies
vinieme12
Champion III
Champion III

Use below

TableA:

LOad * inline [

Policy,EventID

PU_AL_SEP__FOUND,667

PU_AL_SEP__NOT_FOUND,656

];


mapA:

Mapping

LOAD Policy,

    '@start'&Policy&'end@'

Resident TableA;

OUTPUT:

LOAD *, TextBetween(MapSubString('mapA',Policy2),'@start','end@')  as Policy

inline [

Policy2,Status,etc

23 - sdfsdfsdfsdfsd (PU_AL_SEP__FOUND),1,Y

1234- adasd PU_AL_SEP__NOT_FOUND,2,X

];

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.