Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Compare between 2 files , and create new file with sheet names Trade, Document, Difference

BRRLL99
11 - Bolide

Hi Team,

 

I have 2 files which i need to be compared and create new sheet in Alteryx, which needs to be joined on the basics of ISIN column

 

expected output file has been attached at end I'm looking for all sheets need to be in one file ( Trade, Document, Difference)

 

 

 if background highlight is not possible at least mark difference amount in red color

 

File : 1 ( Trade)

 

NameSlnoISINCol_VolumeCol_Amount
HK-01A1619K10010
HK-01A2629K20030
HK-01A3639K30050
HK-01A4649K40070
HK-01A5659K50090
HK-01A6669K600110

 

File : 2 (Document)

 

ISINCol_VolumeCol_Amount
619K10010
629K20088
639K80050
649K40070
659K50033
8 REPLIES 8
Hammad_Rashid
11 - Bolide

 

  1. Input Data:

    • Read both files ("Trade" and "Document") into Alteryx using the Input Data tool.
  2. Join Tool:

    • Use the Join tool to combine the two datasets based on the "ISIN" column.
    • Configure the Join tool to join on the "ISIN" column.
  3. Select Tool:

    • Use the Select tool to choose the columns you want to include in the output.
  4. Formula Tool for Difference:

    • Add a Formula tool to calculate the difference between corresponding columns from both files.
    • For example, if you want the difference in "Col_Amount," the formula would be something like: [Col_Amount_Trade] - [Col_Amount_Document].
  5. Filter/Conditional Formatting:

    • If you want to highlight the differences, you can use the Filter tool to separate rows with differences.
    • For conditional formatting (like red color), you can use the Multi-Row Formula tool to add an HTML tag for styling based on the calculated difference.
IF [Difference] < 0 THEN "<span style='color:red'>" + STR([Difference]) + "</span>" ELSE STR([Difference]) ENDIF
  1. Union Tool:

    • Use the Union tool to combine the original data with the calculated differences.
  2. Output Data:

    • Finally, use the Output Data tool to save the combined and modified data to a new sheet or file.
BRRLL99
11 - Bolide

How can create new file

with sheet names >> Trade, Document, Difference

caltang
17 - Castor
17 - Castor

Like so:

image.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
BRRLL99
11 - Bolide

Thank you for your response

 

but my output should have 1 excel file and 3 sheets in it.

 

Trade(sheet-1) , Document(Sheet-2), Difference(Sheet-3)

Qiu
21 - Polaris
21 - Polaris

@caltang 
Thank you. I was struggling with how to assign the Sheet name with Render tool. Learned new thing from you.

@BRRLL99 
I have similar approach with @caltang with slight difference on the Column Rule using.

1129-BRRLL99-A.PNG1129-BRRLL99-B.PNG

caltang
17 - Castor
17 - Castor

The honour is mine @Qiu - your method is cleaner!

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
rohit782192
11 - Bolide

You can use Spreadsheet compare Tool which is available readily in Windows 11 for Comparison of File.

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels