Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Swap values in the same row between two columns

Hello,

Is it possible to swap values in two columns for the same row?  For example; Row 10-Column A and Row 10-Column B need to have the values swapped.

 

NOTE:  All other values in these columns are correct.  For some reason, these two particular values must have been entered incorrectly in the source data.

 

Any help would be appreciated

  • Hi Anonymous

     

    First Add an Index Column from the Query Editor to identify row number

     

    then you can use this Custom Column to get revised Column Values with swapped rows

     

    if [Index]=10 then [Col B] else [Col A])

     

3 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous

     

    First Add an Index Column from the Query Editor to identify row number

     

    then you can use this Custom Column to get revised Column Values with swapped rows

     

    if [Index]=10 then [Col B] else [Col A])

     

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks Zubair.  That worked very nicely.  I actually had the ID already inserted but wasn't connecting the dots enough to think of a conditional column like that.  For the record, I actually had a couple of incorrect values to change.  I also added a second column to complete the swap.  I've included some notes in case someone has a similar problem in the future.