I am trying to find how to do the following. I need to fill a string (a word) in a column that I can change from a table. Static way: Add Column > In formula ="FORD" So it fills all existing rows in the columns Variable way: If I change to HONDA the cell at the table, use the new word in the query Thanks!
Something like https://stackoverflow.com/a/31522846/771768 will work:
Click on the Excel cell with HONDA, then open menu Power Query > Excel
Data > From Table (uncheck "My table has headers")
In the Power Query editor, right click on the HONDA cell of the table
and "drill down" to get the text value, and change your add column step to use this Column1
You can edit the value in sheet 1, and when you refresh your query
you'll see sheet 2 is changed.
Related
I have a dataSet of person.
Is it possible to iterate and add label and dynamic text from dataSet in this format.
Name: John
Address : This is an exemple
Others label/text
Name: Alex
Address : This is an exemple
Others label/text
And so on.
Thanks.
You can use a list item instead of the table item.
Bind the list item to the data set (just as you would do with a table item).
Then, inside the list item's detail area,
create a grid item, say 2 cols x 3 rows.
You can that add your labels (static texts) like "Name:" to the cells in the left column and the data items to the right column of the grid.
I want to populate a new column with a specific cell using Power Query exactly like this:
from this -->to this
This task has been taught here: https://exceleratorbi.com.au/convert-a-cell-value-into-a-column-with-power-query/
but I start with a structured table within the worksheet and so the Power Query only reads the table, leaving out the specific cells that I need (which are B2 and B4), as displayed here.
Excel
Query
So how can I do the same thing?
Here is a complete example, starting with a worksheet like this:
Click on the specific cell containing the value with which you want to populate a new column (B2), enter a name in the name box (cellCategory), and press Enter. Right-click the cell and click on Get Data from Table/Range... which opens the Power Query Editor.
Open the Advanced Editor, delete everything, enter this line of code and click on Done:
Excel.CurrentWorkbook(){[Name="cellCategory"]}[Content][Column1]{0}
Named ranges that are loaded in Power Query are automatically transformed to a table. In the line above, [Column1]{0} accesses the value located in Column1 at row index 0 of that table which contains a single cell. So now you have a query that returns the content of that cell.
If your main table isn't yet loaded to Power Query, return to the worksheet, right-click on your table and click on Get Data from Table/Range....
Now, as shown in Step 5 of the linked tutorial, go to the ribbon tab Add Column, click on the button Custom Column, and add a new column named Category filled with the cellCategory query value by entering cellCategory and clicking on OK:
Here is the result:
I am wondering if you can have other tables show based on the value selected in the main table. I am not opposed to drill-down either.
My main table is the summary and was hoping to show additional data when the user clicks on a Type. When clicked another table would be visible. For example, in the screenshot, the Pool table would be visible when the Pool type is clicked in the main report. As mentioned if this is easier as a drill-down then I will do that, but not sure how. The report currently has a dataset for each table. Do I need to combine the datasets to do a drill-down?
Main and child tables
The best way to accomplish what you described is with a drill down and you would need to combine the datasets into one.
Combine your datasets
Add a table to your report and reference the single dataset
Add your detail row group to the table - from your child table (Area, Average)
Add a parent group to your details row, group your detail row group by Type, it should add a Type column to your table. Delete this column and it will ask you to delete the associated group as well. Select the option to delete only the column.
Recreate your table by adding rows, be sure to match the grouping indicators (brackets) on the left side
Right-Click on the bottom row in the box where the bracket is to highlight the entire row, click Row Visibility. For the option "when the report is initially run:", select Hide. Check "Display can be toggled by this report item" and select the name of the textbox that contains [Type]. If you don't know what this is, exit out of the dialogue box and right-click on the cell [Type] and click Textbox properties, the Name will be in there
Repeat step 6 for the label row for your details row (second row from the bottom)
I have a report where I need to add a note/number where a record has data in a particular column. I then need to add a reference to that to the bottom of the table, much like a footnotes section you would see in a book.
I've tried adding the rownumber but it pulls in the actual rownumber and not the record count. I'm using oracle for my db.
In my report, if the record has a value for the column RETURN_NOTE (not shown), then concatenate an int tot he end of the TASK_NAME column. Then underneath the table, add the int from above with the RETURN_NOTE value.
You can see the red numbers and their description in the image below.
Thanks
The best way to go here is when you add a calculated field to your dataset where you put your footnotes into the expression. Lets assume your footnotes depend on the Fields!Task.Value and lets call this calculated field Footnotes:
'Name: Footnotes
=Switch(Fields!Task.Value = "Prepare for Coordinator", 1, Fields!Task.Value = "Ready for Closeout", 2)
Now add another column to your tablix and put the field Fields!Footnotes.Value in this column.
Then add a rectangle or another tablix somewhere in your report (put in the values which explains the footnotes). Then go to the properties of this tablix/rectangle (pane on the right) and under Other > Bookmark write in a bookmark code (for example: FootnotesExplained).
Go back to your textbox with the Fields!Footnotes.Value in it and right click on this textbox and go to Text Box Properties > Action and check the Go to bookmark option and write below your bookmark code from before FootnotesExplained.
When you click now on one of the value in the column where the footnotes are the report will jump to the tablix/rectangle where your footnotes descriptions are.
I have one web table, in this I want to delete particular record by clicking on record's delete button.
I got the value of row but I am not able to perform click on web button of particular row and also there is 2 buttons in one column.
How to click on delete icon of particular row?
You need to set a reference to the item within the specific row and then click on it - something like this:
Set oLink = Browser("myBrowser").Page("myPage").WebTable("myTable").ChildItem(iRow,8,"Link",0)
oLink.Click
You will potentially need to amend the "Link" and the number 8 in your own code. iRow represents the row you are trying to interact with.
Essentially what this code does is set an object reference to the first item of type "Link", in column 8 of the table, then uses a Click event to select it. If your delete icon is a WebButton, then replace "Link" with "WebButton" for example. The final 0 in the command tells UFT to select the first element matching the object type - you might need 1 if your two icons are in the same column of the table.
Let me know if that helped.