Alteryx Designer Desktop Discussions

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

Data overwrite based on count of records

Shreyash41
7 - Meteor

Hello,

 

I am working on a alteryx workflow that reads a file with two sheets-1)attributes 2)Loans

Loans Sheet has two columns-Loan numbers and category.

 

My workflow joins the attribute sheet with a sheet from different file and pulls the corresponding data for attributes and writes to a already existing  sheet named attributes and the other part of workflow reads the loan category, divides the loans based on it and writes to two different files with a condition that each sheet will have only 200 loans-done using groupID . (overwrite after each successive run).

 

Note-This is the same o/p file as the one in which attributes are written after join operation

 

Since the number of loans could be different in each run hence creating a different number of sheets- my final o/p files contain data overwritten to existing sheets (based on count of loans), but it also ends up containing the old sheets that didn't get written over due to change in number of loans.

 

How do i solve this?

 

Thanks in advance!

 

Shreyash41_0-1652358033640.png

 

 

6 REPLIES 6
grazitti_sapna
17 - Castor

Hi @Shreyash41 ,

 

Did you try configuring your excel output to something mentioned below?

grazitti_sapna_0-1652358394228.png

 

The above configuration with overwrite your sheet every time you run your workflow.

 

Thanks!

 

Sapna Gupta
Shreyash41
7 - Meteor

@grazitti_sapna  Hey, thanks for responding so quickly, but i am afraid that's not the solution for this particular problem. The workflow writes over the sheet corresponding to new loan count but the sheets that are not overwritten sadly stay the same sheet unaltered. I want the workflow to remove old sheets that weren't written over and just contain the new sheets as per new count.

grazitti_sapna
17 - Castor

@Shreyash41 - isn't it possible to just simply create a new file every time with same name so that it will delete all the legacy sheet if that is the case or you appending new data to the existing sheets?

Just to get better understanding the new loan is simply a new row in your file according to which a new sheet is create in the file that you are using right?

 

Sapna Gupta
Shreyash41
7 - Meteor

Yes, new loans are simply additional records added to loans sheet in input file. The loans count impact the sheets overwritten in output file. I am trying not to create multiple versions of same file which is why it is a little tricky.

 

 

grazitti_sapna
17 - Castor

@Shreyash41  what I was trying to say is you can simply overwrite your existing excel file rather than overwriting the sheets. In this scenario it will automatically remove all the sheets in your excel file and will write with the new one as I am not sure if there is any other way to delete the tabs/sheets from excel. Is it possible for your to share the sample workflow or screenshots for the desired output?

Sapna Gupta
Shreyash41
7 - Meteor

@grazitti_sapna - I tried what you suggested, a couple variations actually, but that doesn't seem to have the expected effect. 

 

For privacy reasons unfortunately i can't show you the expected outcome as such, but think of it like this-

 

Every time you are removing the previous file and creating new one, you are not only writing loans, but writing attributes to same file in parallel. Eventually the data written last will survive.

Labels