community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

How to delete the exiting months data from a historcal file.

Asteroid

Hi Team,

 

I have two files .One is historical file and the other one is current file. as in below screenshot.

 

Historical file :- where I have Jan,feb and March data.

 

Historical file.PNG

 

Every month I get a new file and I need to append this to historical file.

 

New file :- Again with March and feb data.

 

new file.PNG

I want to delete existing feb and march data from historical file and append new file data to historical file.Is there a way to do that automatically. Because I would be getting the new file as a quarterly or monthly data. Hence wanted to delete the old data which was already loaded so that there is no duplication.

Or if there is any update to the numbers to old month data,I need to delete the entire data for old month and append the old month data from new file.

Can you guys help.

 

Regards,

Haya

Alteryx Certified Partner
Alteryx Certified Partner

@haya

 

First things first, create a new field that formats your dates as months. After that, you can use the outer join from a Join tool and union the unique original records to the new fields.

 

Solution example attached.

Asteroid

Hi Thanks for your reply.

 

But this will not work as there might be complete different records in new files for older months and want to delete the complete records which was previously loaded and load the new file.

Alteryx Certified Partner
Alteryx Certified Partner

@haya,

 

Have you considered modifying @CharlieS's solution to include the person as part of the join (or person entirely)?

 

If "Hiya" is in both new and old data, you want to keep only the new (right) data? 

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Asteroid

Hi ,

 

So in historical file we can have "Haya,ramni,babitha and sham" as part of "March and Feb " data.

 

historical1.PNG

 

But in new file it can be some other name as well.So in this case I want delete the entire rows for March and feb if we have data for the same months in new file and append the new data.Do we have any solution to do the same?. Deleting or filtering out historical file for the distinct date values in new file as a loop?.

 

newfile.PNG

Alteryx Certified Partner
Alteryx Certified Partner

@haya

 

So if you want to remove any March observations when you have new March data (even when the list of names differs), then remove "Name" as a join field from my solution. If you only join on date to filter the unique date results and union that to the new records you'll have that solution.

Labels