Forum Discussion

SnapWizard's avatar
SnapWizard
New Contributor III
4 years ago

Joining two files without a common value

I want to join two files based on a field of file 1 containing the value of a field in file 2. What would be the best way to do this?
e.g.
File 1: $district_name='ABC School District". File 2: $district: ‘ABC’.
So if $district_name.contains($district). I want to set $new_district in File 1 to $district

1 Reply

  • viktor_n's avatar
    viktor_n
    Contributor II

    Hi @Szymon,

    With parseFloat() function.

    Like this parseFloat($amount.toFixed(2))

    Regards,
    Viktor

  • Szymon's avatar
    Szymon
    New Contributor II

    Puh! Apologies, that I have not described everything I had tried before posting.
    Among others, I had tried parseFloat as well.

    I wonder if you have tried it yourself, jolly good. Pipeline is attached
    parseFloat($amount.toFixed(2)) will remove the decimal ‘.00’, so this brings nothing.
    As a result you would get: 1000 → “1000.00” → 1000

    Again I need to add decimals to 1000 to get 1000.00, NOT to “1000.00”

    {
    "amount" : 1000.00
    }
    

    anyone?
    thank you.
    toDouble_2022_01_12.slp (5.9 KB)

    • bojanvelevski's avatar
      bojanvelevski
      Valued Contributor

      Actually, It will not. I agree with @viktor_n on this one. This is a validation from the pipeline you attached:

      Don’t rely on the preview within the snap, check the actual output after validation.

      Regards,
      Bojan

  • Szymon's avatar
    Szymon
    New Contributor II

    Arrgh! Indeed, Bojan, you are right. I always forget, that one should not relay on just a half-reliable platform. Also, if runtime presents the result same as validation.
    Terribly sorry for that. I suppose, it comes from the habit of using other mature integration tools. I promise to remember that in the future. I must admit, it presents a certain kind of a thrill “Oh goodie! which feature is reliable in this release, my-oh-my!” - very exciting.
    Thank you and kind regards.

    Output:
    [{"amount":1000.00}]

    Updated pipeline attached.
    toDouble_2022_01_12.slp (8.6 KB)