Inserting a new column

JRowe
JRowe Member
edited December 2023 in General

Hi. Is there a way to insert a new column in a file and specify what values you want that column to contain (new values that are not in the file today)?

I am working with result files from tests in PCSM and need to compare them, but the files need a unique key. I just need to create a column in each with a numerical value from 1 upwards as the input data records are the same for both tests.

Best Answers

  • Danny Roden
    Danny Roden Administrator
    edited December 2023 Answer ✓

    Hi @JRowe,

    A couple of options available are:

    • On a workflow you can open up the 'source' step's 'more options' button and check the 'Include unique row IDs' checkbox:
    • Another option is you could add a rowID (or you might want to call it a RoweID 😊) using a Transform (this can be done in explore mode so will work in Views as well as in Workflows) e.g. click 'Transform' —> 'Insert New Column' —> Search for the 'Current Row' function and hit 'Apply'

    Does that help?

  • Josh Boxer
    Josh Boxer Administrator
    edited January 15 Answer ✓

    Hi Jennifer, this is coming in the next release with a new output available in the Compare step that will show for each record and each column being compared where the data does not match:

Answers

  • Super! Thanks so much @Danny Roden 😁

  • So @Danny Roden
    I added a column using the Transform function and the results now show me which records have changed, but how do I see what data in each record changed?

  • Danny Roden
    Danny Roden Administrator
    Assuming you want to compare the 2 sources using the same key (ie the RoweID that you’ve created using the above steps) then the ‘Compare’ step would be a good option to consider using in your workflow as this will show a summary of which records are identical and which are different for a given ID.
  • Sorry - I am not being clear with my question. I added the Compare step, but the output merely shows me which records have changed. I need to know what data on the "changed" records has changed.

  • Danny Roden
    Danny Roden Administrator
    Ah. This is coming in a future iteration of the Compare step but for now you will need to add other steps to your workflow to do this. Eg filtering the output of the compare step to just the values you’re interested with (eg those that have changed) and then using a Join back to the source(s).
  • Cool. Let me try that 😁

  • JRowe
    JRowe Member

    Hi @Danny Roden Happy New Year :)

    So I have the compare flag appended with the data from the first test and the final test, but I have no idea how to highlight where in this data the information has changed. Is this possible? Do I have to wait for the proposed change to the Compare function?

  • JRowe
    JRowe Member

    Fabulous! Can't wait 😁