Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qingkong
Contributor II
Contributor II

Multiple conditional substitution values

I have a multi-conditional data substitution,

Would you like to ask whether to write in a script or in a chart?

I want to get the picture

I have uploaded the attachment

replace1.JPG

1 Solution

Accepted Solutions
anthonyj
Creator III
Creator III

You're welcome @qingkong . Glad I could help. 

If you could mark the problem solved it will help others looking for solutions to similar issues.

Thanks

Anthony

View solution in original post

3 Replies
anthonyj
Creator III
Creator III

Hi,

If I've understood your request correctly and you're looking for the "Replacement Values" to be in the same column, an applymap() function in the load script will do this for you: 

For example:

ReplacementMap:

mapping
load * inline [
Replace Value
P101 ROH WH
P102 ROH WH
P103 ROH WH
P104 ROH WH
P105 ROH WH
P106 ROH WH
P107 ROH WH
P108 ROH WH
P109 ROH WH
P110 ROH WH
P111 ROH WH
P401 ROH WH
P402 ROH WH
P301 ROH MFG
P302 ROH MFG
P303 ROH MFG
P304 ROH MFG
P305 ROH MFG
P306 ROH MFG
P307 ROH MFG
P308 ROH MFG
](delimiter is '\t');

And then you apply it to your data.

data:
load *,
applymap('ReplacementMap', SLoc, SLoc) as SLoc2

From YourData;

I think this would be the easiest way. Other options can be done in the charts but it would be a nested "if" and match statements.

Regards

Anthony

 

qingkong
Contributor II
Contributor II
Author

Dell : Anthony  thank you   Problem solved 

anthonyj
Creator III
Creator III

You're welcome @qingkong . Glad I could help. 

If you could mark the problem solved it will help others looking for solutions to similar issues.

Thanks

Anthony