File Browse in Alteryx - New File Selected when it is run - alteryx

I'm somewhat new to Alteryx, and I'm stuck on inputting excel files correctly. My goal is to utilize the File Browse tool so that the user of the app/workflow can select/input a new file when it is run. While the files inputted may differ each time, the format will always be the same. This file will have multiple tabs, but I only want to read in two tabs (the name of these 2 tabs will always be the same no matter which file is selected, let's say the two tabs are named X1 and X2). The goal is to take each tab and perform cleansing and manipulation on the two tabs separately, and then union them back in the end. How can I set up the File Browse -> Input Data (or Dynamic Input) to take in a new file each time, connect them to an input tool, and take the same two tabs to clean/manipulate them?
I am using Alteryx Version 2020.6.4

Related

Is there a way to retain the phone numbers with + sign format when exporting to Excel/CSV

I noticed that anytime I export from somewhere like Salesforce where the Phone = +123124141.
The data in Excel will just become =123124141 or #NAME? or some other Error spouted from Excel.
This makes data patch extremely painful and manual. Any ideas how to get around this?
When you create the file, use a different extension than .csv or .txt (these ones are interpreted by EXCEL as a green light to interpret columns as numeric/date, etc and format accordingly. Use .DAT, for example. When you open it from within EXCEL it will invoke the text import wizard, and there you should choose comma separated (or tab separated, etc, as the case maybe), and on the final screen of the wizard, choose the columns you don't want reformatted (you can choose all of them, if you like), and choose Text. Now the column values will be kept intact.
Alternatively you can first create a blank workbook/sheet, and use Data From Text to invoke the Wizard and bring the data in the same way.
If you don't want EXCEL to launch and open when you double-click on a .CSV file, without asking questions, you can remove the file-association (of CSV with EXCEL) using Windows explorer.
It is reasonably easy to develop a VBA macro to import such delimited files using 'TEXT' data types to automate what the Wizard would do.

SSIS: failed to retrieve long data / truncation errors

I'm getting either of those two errors when trying to export data from a set of excel spreadsheets.
Simplified scenario:
two excel spreadsheets containing 1 text column
in file 1 the text is never longer than 200 characters
in the 2nd - it is.
SSIS suppose to import them automatically from a folder - easy and simple, but...
Excel source component decides what data type is used here.
When, using created by me sample file with sample text data, it decides to use DT_WSTR(255) it fails with the second file with the truncation error.
When I force it to use DT_NTEXT (by creating longer text in the sample file) if fails with the 1st file complaining that "Failed to retrieve long data for column"... because the 1st file doesn't contain longer texts...
Has anybody found a solution/work-around for this? I mean - except manually changing the source data?
Any help much appreciated.
We can use Flat File Connection Manager instead of Excel Connection Manager. When we create Flat File Connection Manager we can set data type and length explicitly. To do so first we need to save the excel file as csv file or tab delimited file. Then we can use this file to create Flat File Connection. Drag and drop a Flat File Source in the Data Flow tab. In the Flat File Source Editor dialog box click New button and it will launches Flat File Connection Manager Editor dialog box. In the General tab specify the file full path and click Advanced tab. Then put data type and column width like below image.
Click OK and close the dialog box, this will create our connection manager. Now the connection manager can successfully read the full length data but we have to set the data type & length of the Output Columns so that we can get the data in the output pipeline. To do that right click on the Flat File Source and click Show Advanced Editor option. Then follow the below image instruction.
When we finish we run our package and it run successfully without any truncation error and insert all the data in our target database.

How to load prompt values from Excel or CSV files in WebI?

We have report and users want to upload filters to prompts on the reports from excel or csv files. They cannot enter one by one because they sometimes have hundreds of values (customer numbers) to filter. Is there a way to do that? If it is then how is it possible?
Thanks in Advance.
Niki
I'm assuming you're using either Web Intelligence or a different document format that is supported by the OpenDocument feature.
One possibility is to use an Excel file with a column for each prompt value. Use this Excel file as a source for a new Web Intelligence document. Within that document, construct OpenDocument URLs that contains the prompt values you want to pass.
Make sure that you read the OpenDocument manual carefully, as the syntax for passing prompt values differs depending on how the prompt is configured (single value vs. multiple values, etc).
The idea behind this is that you have an easy to maintain Excel file to input/modify the prompt values, and that end-users can open the intermediate Web Intelligence document, refresh it (or use refresh on open) and then click one of the generated links to automatically open the correct document and have all the prompt values filled in.
Example
Consider the screenshot below. It's an Excel file that contains information regarding two documents (Dummy Report and Other Report) as well as their internal ID (CUID) and the prompt values to refresh them with.
This is sufficient information to generate an OpenDocument URL to open these documents for us and automatically enter the prompt values.
The resulting URLs would look like this:
http://<servername>:<port>/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=Aa6GrrM79cRAmaOSMGoadKI&sIDType=CUID&lsSYear=2015&lsSMonth=2
http://<servername>:<port>/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=Aa6GrrM79cRAmaOSMGoadKI&sIDType=CUID&lsSYear=2015&lsSMonth=2&lsSCity=Berlin
Some remarks here:
If your documents have different prompts (e.g. City is a prompt in the second document but not in the first), or some of the prompts are optional, you'll have to check for which columns (prompts) a value has been provided in the Excel sheet and discard the empty ones (should be easy enough).
Unless Single Sign-On (SSO) has been configured in your BusinessObjects environment, you'll still have to log on.
Due to this approach, you can make prompt values dynamic (e.g. use the current year) by using Excel formulas.
The example above is a very simple one. You could have multiple lines referring to the same document but with different prompt values.
Taking it one step further
If you use this Excel sheet as a data source for a Web Intelligence document, you can create a Webi document that contains the OpenDocument links. The added bonus is that you won't have to log on anymore after clicking one of the links, as you're already working in an authenticated session.
Important
Make sure you read the OpenDocument manual carefully so you understand what it is and how it can be used (and more importantly, what you can't do with it). You can find the manual on help.sap.com. Just make sure the version described in the manual corresponds with the version of BusinessObjects deployed in your environment.
Not currently possible. What we did for this requirement was to create a new dedicated table in our database to hold customer-generated prompt values. We then created a simple web page to allow users to upload lists of values. Finally, we created universe objects that associate the customers' LOV table with existing universe objects as filters.

Configure and link Excel to a delimited file for repeated use

I am dumping data in a tab delimited file that I would like to view and analyze in Excel. But the file contents change frequently and I do not want to go through the importing steps every time, i.e. define delimiters, column names etc. Is there a way to save a link metadata in an Excel file so that you can skip the definition steps upon subsequent openings, i.e. that it knows that the first row are column names, it is tab delimited etc.?
Thanks
Yes, you can. Go through the Get External Data route. Once you set it up. All you have to do next is "Refresh Data". No macro needed.

Totaling figures in .csv files using Excel

I have 12 .csv files produced by another program. The .csv files contain numeric data, separated by commas.
I need an easy way of totaling the values in certain columns in each of the files and comparing the totals across the various files e.g. compare the total from file 1 to the total from file 5.
The format of each file is the same i.e. 5 values in each record, separated by commas. Each of the 12 .csv files is about 50 Mb in size. Each file has a different number of records.
The environment I work in is 'secure' and I cant run any programs other than what I have installed on the PC I use. I have Excel installed and assume I can write VBA code/macros and I have access to the Command line. I can't (for example) load anything from a USB key and can not install any scripting language e.g. Python.
I have thought of doing this manually e.g. open each .csv file in Excel and total the columns using Excel functions i.e. SUM()
My challenge I need to do this many times of the next few weeks as new versions of the .csv files are produced i.e. I now have the first version, there will be many versions of the 12 files produced as I conduct testing on the other system. For each new version I need to sum the data and compare across files.
Last thing to say is, I cant change the system that produces the .csv files e.g. to create a set of totals
I'm looking for a programming solution that I can use, given my limited resources (ability to use any tools other than what is already on the PC)
You should be able to do this easily using an excel VBA macro but it might take quite some time if it needs to load and convert a 50MB csv file.
JScript (a microsoft form of JavaScript) is generally available on all machines and runs under the windows scripting host. Just create a file with a .js extension and try to run with a double click. Or you can use vbscript with a .vbs extension.
I think your easiest solution would be to write an excel macro (as you will have the IDE for excel vba as limited as it is).
Powershell or a batch script? A CSV is nothing more than a text file split with commas. Should be fairly easy to knock something up.
ADO can work on CSV files and you could then use SQL statements to sum the appropriate values - see this MSDN article for full details.
If you go to the Visual Basic Editor in Excel then try to add a reference via the Tools menu you should have several for Microsoft ActiveX Data Objects (2.8 being the most recent one.) Adding that reference lets you use ADO.

Resources