recode according to input from file

Hi there,

I would like to read a mapping of codes from an external file and apply this mapping to my data set. Unfortunately I don’t know if this is possible and if yes, how I can do this.

Has anyone an idea for me?

Thanks in advance
marryah

You are definitely going to need to upload a workflow with some sample data / structure. You can get an upload friendly export format by going to File → Export KNIME Workflow…

Not enough to go on here. What type of files, what does “mapping of codes” mean, how does it need to be applied, what is they desired output? So many questions…

The best way to proceed is to let us see what it is you are dealing with in an uploaded KNIME workflow.

2 Likes

Thank you for your answer. Probably my description was inappropriate.
In my data set, I have coded data from one codesystem. I want to translate them to codes another codesystem, that’s the mapping.
Example: Before, I have gender codes “X”, “female”, “male”, “other” and “unknown” and now I want to have gender codes “8521”, “8532”, “8507”, “8521”, “8551”. The mapping therefore would be: “X” => “8521”, “female” => “8532”, “male” => 8507, “other” => “8521” and “unknown” => “8551”.

I have stored all of these mappings (and they are a lot) in JSON files which I also use in other contexts.
I will upload an example up to the point I can.

testForUpload.knwf (12.9 KB)

Hi @marryah, welcome to the KNIME Forum.

Can you re-export your workflow file and upload it here again, but run it first and then make sure the option to “Reset Workflow” is not ticked. As it is, there is no data available to anybody wishing to help you because your file is external to your workflow.
thanks.

2 Likes

Hi @takbb, thank you for the warm welcome. I apologize for the inconvenience. Here is the hopefully correct export. testForUpload.knwf (22.7 KB)

1 Like

testForUpload.knwf (42.0 KB)

I don’t get what you uploaded on the csv side. There is no column in which those values exist to replace. However, I built you something that would replace those values in a column if the data was present and it was pointed to the column that required value replacement…

3 Likes

@iCFO: Despite my error in the input file you solved the problem.
Thank you so much!!!
Greetings from Germany

3 Likes

Awesome! Happy to help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.