Hi Community,
I have imported the txt file into alteryx and performed the text to column formula. Due to the different number of spacing in between , it created the result data A as shown below. However, i want the data that begin with IN only and plan to filter the text with the beginning of IN and tabulate into new column again as shown below.
May i know if anyone of you know how to fix this?
¡Resuelto! Ir a solución.
Hey @SH_94
Now that I see all the different configurations how your data is being presented, I do have a solution that should account for all the differing variables.
This new solution reads the file in as a fixed width file to break out the Customer Number, Customer Name, Batch, and all other fields first. The input is also including the file name as a field, so you can then change that at the end to your desired country as you mentioned.
I'm also importing settings for the flat file in order to make sure that the fixed settings are consistent.
Once the files are read in, I'm Joining them all together and then using a formula tool to cleanup some weird issues with the fixed width and also some character replacements to solve for some field conversion issues later in the workflow.
I then added a multi-row formula tool to add the batch name where missing to all records.
From here the process is similar to the last workflow I sent you. Data Cleanse, Text to Columns, and Dynamic Rename. The only difference is that I added a Select tool to convert the number fields to doubles, and then used a Filter tool at the end to filter out null values from one of the currency fields.
This now leaves you with just the records needed in the output.
Attached is a zipped version of the workflow, which I think I was able to downgrade to your version. If not, I have also attached all the necessary components to the workflow individually, but you'll need to map them on your end. Please note that you'll need to change the extension name of the Fixed Width Setting file from .txt to .flat
If this solves your issue please mark the answer as correct, if not let me know!
Thanks!
Phil
Hi @Maskell_Rascal ,
Thanks a lot for your help. It really very detail and clear explanation. I have few questions as below:
1. Previously we use CSV file to import the file, so currently we choose ASCII, is it because of the file being presented?
2. If i have multiple of txt file to import into the alteryx, may i know do you have any suggestion that i can import once and allow the alteryx to read all the file?I try a lot of macro file that being shared online but it always fails.
3.May i know how u open the flat file layout as per your second screenshot in your post? Could you guide me on which button/icon i need to click?
4.Could you briefly explain the purpose on the formula tool used for the screenshot below? May i know what is the meaning of if =1 and if =0?
5. Could you briefly explain on the difference between Replace and REGEX_ Replace in this case? Any different or impact if we use Replace? May i know normally how u determine whether u need to use Replace or REGEX_ Replace to add into the canvas?
6. For this Multi-row formula as per screenshot below , is it same with the excel formula fill in the blanks?
7.I like the format of table that you rendered out in the excel. Could you please share with me the complete workflow ( with the table setting included).
Thank you again for your help.
Hey @SH_94
I'll answer these in the order you typed them.
Thanks!
Phil
Hi @Maskell_Rascal ,
I have run the imported file in the alteryx and it appears the error as below:
May i know how should i fix this in this case as i have shortened the name of the file.