Forum Discussion

agkolkata's avatar
agkolkata
Regular Visitor
3 years ago
Solved

Can I use  variable inside Table.ReplaceValue function ?

Can I use  a variable inside Table.ReplaceValue function ?

/#"Replaced Value32" = Table.ReplaceValue(#"Changed Type2","noFullApplicationNameTag",Text.From([meterCategory]),Replacer.ReplaceValue,{"custom_TagsFullApplicationName"})

 

note : i dont want to use if else query and create a new variable in the process

I need to check for a value in a field and replace the value using anothe field value in the same viariable itself.

 

Any idea how to do it ? 

 

 

  • Hi agkolkata ,

    Please see code below where I added "each" to 2nd and 3rd arguments: 

    Table.ReplaceValue(
       #"Changed Type2",
       each "noFullApplicationNameTag",
       each Text.From([meterCategory]),
       Replacer.ReplaceValue,
       {"custom_TagsFullApplicationName"}
    )

     

    Regards

    KT

     

4 Replies

  • KT_Bsmart2gethe's avatar
    KT_Bsmart2gethe
    Icon for Impactful Individual rankImpactful Individual

    Hi agkolkata ,

    Please see code below where I added "each" to 2nd and 3rd arguments: 

    Table.ReplaceValue(
       #"Changed Type2",
       each "noFullApplicationNameTag",
       each Text.From([meterCategory]),
       Replacer.ReplaceValue,
       {"custom_TagsFullApplicationName"}
    )

     

    Regards

    KT

     

    • agkolkata's avatar
      agkolkata
      Regular Visitor

      Addon question:

      Can we use a combination of 2 variables and a fixed text as the replacement value in this ?