In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Append and Replace the csv output

SH_94
11 - Bolide

Hi Community,

 

I would like to build the workflow to render out the csv output but before generating the ouput , it will check the following :

Firstly , If no file exist in the desired directory, then generate the output.

Then, if there is existing file in the desired directory, check the relevant field - company code and fiscal year whether there is already existing data , if there is existing data , replace the data , if there is no existing data, the append the csv file.

 

 

I used sample data below to explain the concept above:

Scenario 1 : No file exist, alteryx just generate the csv output

 

Scenarior 2: Output File exist , check first the company code and fiscal year field. 

Existing data in Output  file - 

Company Code           Fiscal Year

DK01                              2022

DK02                              2023

 

 

New Input data

Company Code           Fiscal Year

DK01                              2022

DK02                              2024

EG01                              2022

 

New data in output File 

DK01                              2022 ( new input data replace the existing data)

DK02                              2023 ( existing data)

DK02                              2024 ( new input data)

EG01                              2022 ( new input data)

 

Appreciate the guidance on how to build the above workflow  and thank you in advance.

 

3 REPLIES 3
Luke_C
17 - Castor
17 - Castor

Hi @SH_94 

 

You're going to need to do a few things:

 

  1. Directory tool to see if there are files in the folder
  2. If there are, dynamic input tool to read them in
  3. Then use joins & unions to figure out which data is new vs existing (successful joins = existing but also in new input, fall outs would be new/existing records not in the input).
SH_94
11 - Bolide

Hi @Luke_C ,

 

Thank for the prompt response . Could you share with me sample of worklfow that working in this scenario.?

 

 

THank you.

 

Luke_C
17 - Castor
17 - Castor

Hi @SH_94 

 

I'd suggest you give it a shot, happy to help troubleshoot your workflow once you've taken a stab at it. 

Labels
Top Solution Authors