EXCEL Files with IBM info datastage - websphere

I have some issue about "Configure the Unstructured Data stage" function in IBM info datastage.
This excel file often add columns but system need me specific data range ex.(Sheet1!A1:Z1)
So I want to know that can I specific data range like first column to last column of Sheet1 ex.(Sheet1!A1:MAX(COLUMN)1)
Thank you and apologize about my English skill

To set the range to the last column, you can use the 'Range Option' and 'Specify the start row'. This will automatically find the end row of the data range. If the start row has columns to column K, it will read through column K of last row. Whereas 'Specify the entire data range' you must specify both the start row and the end row of the range. You can see the description in yellow box if you put the mouse over the 'Range Option' drop down box.
If needed, there's an example you can exercise with, refer to
https://www.ibm.com/support/knowledgecenter/SSZJPZ_11.7.0/com.ibm.swg.im.iis.ds.unstructureddatastage.usage.doc/topics/uds_examples.html
with range option configuration in Example 1.

Related

Robot Framework how to use FOR loop for a specific column in a table

I want to know how to use a FOR loop for a specific column in a table.
Basically. I want to get the text in the third column and equate / verify it to be "LOCAL" for all rows. I will provide a basic diagram of the table
So, in the diagram the checkboxes take up as first table cell and the top row is a table header.
What i want is to get the text of all the cells under column /th4 and equate it to be as "LOCAL" as said before. There might be multiple entries and will be dynamic. So, that is why i want to use FOR loop.
PS: every cell under /th4 is LOCAL , so just want to equate the text.
My code:
Click Element xpath=//*[#id="selectType"]/div/div[2]/ul[2]/li/div
Sleep 0.1
Click Element class=dropdown-btn
Sleep 0.1
Click Button id=filterBtn
Sleep 0.1
Click Element id=closeFilter
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[1]/td[4]/span 1 LOCAL
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[2]/td[4]/span 2 LOCAL
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[3]/td[4]/span 3 LOCAL
Basically, there is filter option... once i filter, the fourth /td in the table will all contain text "LOCAL".
Instead of me manually typing "table row should contain" keyword, i want to for loop it to verify all the cells in that column
Let me know if any other information is required.
Thanks and Regards,
Sandesh K S
For loop is not the best option here because you usually need to know beforehand how many elements you have and you mention that number of rows can change. It would be better to use while loop:
${row}= Set Variable 1
WHILE True
${elements}= xpath=//*[#id="myTable"]/tbody/tr[${row}]/td[4]/span
${num_elements}= Get Length ${elements}
IF '${elements}' == '0'
BREAK
END
Table Row Should Contain xpath=//*[#id="myTable"]/tbody/tr[${row}]/td[4]/span 1 LOCAL
${row}= Evaluate ${row} + 1
END

Power query - strategy for handling repeating rows

Given a report which as a table with repeated row headings, is there a good strategy for using Power Query/M to extract the data in a clean format?
For example the report available here, has an excel file (which at time of writing is pointing to August 2021):
https://www.opec.org/opec_web/static_files_project/media/downloads/publications/MOMR%20Appendix%20Tables%20(August%202021).xlsx
In this example:
we have the World demand table portion
Non-OPEC Liquids production portion
both of these have rows: Americas/Europe/Asia Pacific:
which makes it hard to distinguish them in Power Query
What is right approach which would allow extraction of data from this type of table?
I would add a column ... custom column ... with formula
=if [2018] = null then [Column] else null
and then right click the new column and fill down
That would put World Demand and non-OPEC as a column that you could additionally filter on

sorting in excel error when duplicate data

I am trying formula for sorting of a column in excel. Data is entered in one column and sorted data is output in another one. Please see attached excel file.
As you can see due to same data in second column I am getting rank 2 twice and VLOOKUP cannot find entry named 3 so it is giving error. When all data entered are unique there is no problem but in case of duplicated data I am having problem. What can I do?
Kbv.
Just noticed a third possibility that you miight be looking for. So you want to sort the B items where column A indicates the rank of each item in B:
C2
=VLOOKUP(SMALL($A$2:$A$7,ROW(1:1)), $A$2:$B$7, 2,FALSE)
Old answer:
If you want a custom sort where column A indicates the rank of the resulting item inC , copy the following formula in C2 and fill down.
C2
=SMALL(B$2:B$7,A2)
If you want just to copy the column as sorted "naturally", you dont need any helper column, just type this in the first row and fill down (I used column D in my example image below):
D2:
=SMALL(B$2:B$7,ROW(1:1))

Tableau create a table matrix?

I have a CSV file that looks like this. It is in matrix form where cell A1 is empty. I want to visualize this in Tableau like this
a1,a2,a3
a1,1,0.2,0.3
a2,0.3,1,0.5
a3,0.6,0.7,1
How can I build this in tableau to show a matrix?
I tried putting measure name in both the row and column field and measure values in the marks text box but i ended up with diagonal values which isn't what i want.
First structure your data in the form of a table.
A well structured CSV file for Tableau (and most tools) has a single header row that labels each column (so skipping the first cell in the header row is a problem). Then each data row that follows contains only values in each field separated by columns (so there should be no leading row labels)
Order is not significant in a relational table. The rows in a table form a set, not a matrix.
So your CSV should look something closer to
field_name_1,field_name_2,field_name_3
1,0.2,0.3
0.3,1,0.5
0.6,0.7,1
Normally, the prime use of Tableau is display an aggregated summary of the data, not to display each individual data row. So you can put measure_names on columns and measure_values on the text or label shelf to get a summary of each measure (by default a sum)
If all you want to do is to view the underlying data rows in a table for diagnostics, the easiest way is to use the view data button or menu command.
If you want to build a visualization that displays all the data (without summarizing it) in a table, you have two ways to go. The simplest is if you have a unique primary key in your data, you can place it on the row shelf to get a row in your viz for each row in your data.
If your data rows do not have a primary key, you can turn off aggregate measures from the Analysis menu, but then you'll see multiple values in each table cell. Then to get a row in your viz for each row in your data, put the calculation index() on the rows shelf and change it to discrete.

Sort Rows in Excel?

I have an issue with an excel spreadsheet I want to see if I can do without VBA just because it seems easier to implement that way. Basically, there are many columns in the sheet I want to sort. However, I merely want to look at three columns: the title column, the data column and the status column.
In a new spreadsheet, there will be four sections. Each section corresponds to 3 months of the year (ie Jan, Feb, Mar. will map to the first column on the new spreadsheet, April, May, June will map to the second column on the new spreadsheet).
Based on the date, and if the status column has the word "Finished" (in the original spreadsheet), I want to map the title to a certain column under the new spreadsheet based on the date criteria as described in the previous paragraph. So for example, if the original spreadsheet has following:
Title Date Status
Doc1 1/12/13 Finished
Doc2 2/10/13 UnFinished
Doc3 4/1/13 Finished
Doc4 3/31/13 Finished
Would map to, on the new spreadsheet:
1st Column | 2nd Column
Doc1 Doc3
Doc4
I have looked a lot into pivot tables but I can't "automate it" as much as I want to. I have gotten it down to the point where I can change the pivot tables into filtering based on date, but I want it even more automated than that. I've also tried excel formulas but that has been to no avail. Thanks for the help, I really appreciate it!
With a PivotTable it seems fairly easy to 'automate' as far as Sheet 2 as below:
but from there to the result requested is relatively 'manual' without VBA, so may not suit.
For my convenience I have changed the date formats. The PivotTable is constructed as usual/indicated without showing grand totals for rows or for columns (PivotTable Options, Totals & Filters). The Column Labels are Date with Grouping By Quarters with appropriate Starting at: and Ending at: (Group) and Collapse Entire Field (Expand/Collapse).
The formula in I6 is to convert the document count (always 1) to document name:
=IF(F6=1,$E6,"")
However, to allow room for additional quarters in the PivotTable the formula should be moved to the right. The formula would need to be copied across and down as necessary.
The process becomes more ‘manual’ with copying the results of these formulae, pasting them (with Special / Values) into a new location (in the example 2!A1) and, if required, deleting blanks.
This may be against the rules with regards to maintaining the integrity of the OP's request, but hopefully it doesn't offend :)
Here's another option.
Add another column (shame on me, I know) to the original data, and
called this Quarter. The formula that goes next to the existing data
is the following.
=IF(C2="Finished",IF(MONTH(B2)<=3,"Q1",IF(MONTH(B2)<=6,
"Q2",IF(MONTH(B2)<=9,"Q3","Q4"))),C2)
Basically, if the status is "Finished", then determine in what quarter the date is.
Create the pivot table with that data, and then add "Quarter" and
"Title" to the Row Labels (in that order)
Last thing would be to click the arrow next to "Row Labels" and select "Does not Equal" under "Label Filters". There you'll type "Unfinished" (no quotation marks). This will give you something like the image below.
From here the only manual thing you'll need to do is update the data range for the pivot table if more rows are added to the pivot table data and refresh the pivot table if the original data changes
NOTE: To address your question about sorting; after you do the steps above, you can select the Row Labels again and do an A>Z sort to get each quarter to be sorted in alphabetical order

Resources