Forum Discussion

GokilaRaviraj's avatar
GokilaRaviraj
Icon for Helper II rankHelper II
1 year ago
Solved

Copy and paste entire colum value to another column

Hi ,

Currently my  table data looks like below

Since we are in October, It shows months from Oct to Next year Dec.

From Next month It shows months from Nov to Next year dec.

This input value column has to be replaced to column MAR-CFY only when it occurs.

Right now MAR-CFY column is not available, It appears When current month is Jan. 

Company InputValueOctcfyNovcfyDeccfyJannfyFebnfyMarnfyAprnfyMaynfyJunnfyJulnfyAugnfySepnfyOctnfyNovnfyDecnfy
 100000000000000000
 100000000000000000

NFY refers to next finyear

If anyone has idea on this, could you help me ?Thanks in advance.

  • May be 

    = if List.Contains(Table.ColumnNames(#"Replaced Value"),"Mar-CFY") 
    then Table.ReplaceValue(#"Replaced Value", each [#"Mar-CFY"], each [Value], Replacer.ReplaceValue, {"Mar-CFY"})
    else #"Replaced Value"

     Stéphane

5 Replies

  • Hi GokilaRaviraj 

    = Table.ReplaceValue(
    Previous_Step,
    each [InputValue],
    each try [#"MAR-CFY"] otherwise [InputValue],
    Replacer.ReplaceValue,
    {"InputValue"}
    )

    Stéphane 

    • GokilaRaviraj's avatar
      GokilaRaviraj
      Icon for Helper II rankHelper II

      Hi slorin 

       

      I tried this, by replacing with oct-cfy to just check whether it is replacing or not.

      It is not replacing the value and even Inputvalue field becomes 0. 

      I guess its because 

      Replacer.ReplaceValue,
      {"InputValue"}

       Instead of Inputvalue, Mar-Cfy should come in place, It tried that, But it says Mar-cfy not found in table.

       

    • GokilaRaviraj's avatar
      GokilaRaviraj
      Icon for Helper II rankHelper II

      = Table.ReplaceValue(#"Replaced Value",each try [#"Mar-CFY"] otherwise [Value],each [Value],Replacer.ReplaceValue,{"Mar-CFY"})

       

      This is formula i modified. It says Mar-CFY of the table wasn't found.

  • May be 

    = if List.Contains(Table.ColumnNames(#"Replaced Value"),"Mar-CFY") 
    then Table.ReplaceValue(#"Replaced Value", each [#"Mar-CFY"], each [Value], Replacer.ReplaceValue, {"Mar-CFY"})
    else #"Replaced Value"

     Stéphane