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: 
coloful_architect
Creator II
Creator II

put if function and wildcard at dimension of a table

Hi 

I have a table like below:

I want to change the filed of Agent in a condition that as long as Customer Name contains key word A or key word B,

the field of Agent 's value changes into Agent Manager from Agent D/E.

I guess this involves a if function with wild card like * key word, or something like that. 

how do I make the expression at agent field?

something like this ? "if customer name ={* key word), Agent X, Agent "

 

 

ID User Name Customer Name Agent Measurement A Measurement B
    Customer Name A Agent A    
    Customer Name B Agent B    
    Customer Name C Agent C    
    Customers with key word A Agent D    
    Customers with key word B Agent E    
Labels (2)
2 Replies
sidhiq91
Specialist II
Specialist II

@coloful_architect  Please see the below code that I have used. I have also attached the output.

NoConcatenate
Temp:
Load * Inline [
Customer Name, Agent
Customer Name A, Agent A
Customer Name B, Agent B
Customer Name C, Agent C
Customers with key word A, Agent D
Customers with key word B, Agent E
];

NoConcatenate
Temp1:
Load [Customer Name],
if( WildMatch([Customer Name],'*key word A*','*key word B*'),'Agent Manager',[Agent])
as [Agent]
Resident Temp;

Drop table Temp;

Exit Script;

If this resolves your issue, please like and accept it as a solution.

coloful_architect
Creator II
Creator II
Author

my bad. I should be more specific. I only want to have this expression to reflect at a table for that field "agent" instead of at loading script.

I changed your loading script code a bit to adapt into chart expression for agent filed.  it says error in expression. not sure what I missed.

  may I ask what the chart expression should look like?