Replace function

M.Lambert Member
edited December 2023 in General

Hi there, I am trying to make a function to replace some values with null. I did it with on value but wanted to add more so I can clean more with one function. Can you help, please?

Best Answer

  • M.Lambert
    M.Lambert Member
    Answer ✓

    Hi Josh, thanks a lot for your help. That was spot on. Have a great day!


  • Josh Boxer
    Josh Boxer Administrator

    Hi, not entirely sure what you are trying to do, but it sounds like you are replace say 'blue' with null, but want to also replace 'green' and 'orange' with null?

    Firstly just checking but you need to create an advanced Function:

    either follow the link or create a standalone Function.

    Once you have done that there are quite a few different approaches. It is difficult to say which is best without more information on how many values you want to replace?, how similar those values are?, how frequently this list of values might change in future?

    Here is one idea:

    param test;
      _Equals([p:test], {'blue', 'green', 'orange'}),