I would like to create a report that shows the iteration status in real time. I was able to create a query on the Tfs_Warehouse database (see below) however I found that this database is populated from the Tfs_Collection database on timely basis.
Is there a way that I can see the changes to the work items reflected in the report right away?
SELECT *
FROM [CurrentWorkItemView] c
left join [vDimWorkItemTreeOverlay] t on t.WorkItemSK = c.WorkItemSK
where c.IterationName = #iteration and c.System_WorkItemType = 'User Story'
order by c.Microsoft_VSTS_Common_StackRank, c.System_id
Note: this not the full query because I couldn't fit it nicely. Basically it joins 2 table (CurrentWorkItemView and vDimWorkItemTreeOverlay) to get the user stories and associated tasks to each user story.
No, not through the warehouse. When you need up to date information from the work items, use a work item query in Excel or Visual Studio.
You can also use the TFS api to query the operational datastore directly.
Related
I am trying to connect to my organisation's SQL database using Power Query to create some reports. I need to delete/edit some tables and join multiple tables to come up with the desired report output...
I don't want the change or edit I will do on the excel-power query to reflect on the live database but just in excel .
The short answer is no, any button you press in the Power Query Editor interface does not modify the source database. I must admit that I have not found any page in the Microsoft Docs on Power Query that states this clearly. The page What is Power Query? states that:
Power Query is a data transformation and data preparation engine. Power Query comes with a graphical interface for getting data from sources and a Power Query Editor for applying transformations.
Other pages contain similarly general and vague descriptions but let me reassure you that any data transformation you carry out by using the Power Query Editor interface will not modify your SQL database. All you see in Power Query is a view of the source database.
Seeing as you are connecting to a SQL database, it is likely that query folding is activated. This means that when you remove a column (or row), this will update the SQL query used to extract the data from the database. That query is written as a single SELECT statement that can contain multiple clauses like GROUP BY and WHERE. Transformations that add data (e.g. Add Custom Column, Fill Down) are not included in the query, they are carried out only within the Power Query engine. You can read more about this in the docs.
How to edit a database with Power Query when native SQL queries are supported
That being said, you can actually edit a database from within Power Query if the database supports the use of native SQL queries, if you have write permission for the database, and if you edit and run one of the two M functions that let you write native SQL queries. Here is an example using the Sql.Database function:
Sql.Database("servername", "dbname", [Query = "DROP TABLE tablename"])
And here is an example using the Value.NativeQuery function:
Source = Sql.Databases("servername"){[Name="dbname"]}[Data],
#"Native Query" = Value.NativeQuery(Source, "DROP TABLE tablename")
Unless you have changed the default Query Options, these functions should raise a warning message requiring you to permit running the query:
This prevents you from modifying the database without confirmation, so any database modification cannot happen just by accident.
I verified this using Excel Microsoft 365 (Version 2108) on Windows 10 64-bit connected to a local SQL Server 2019 (15.x) database.
It seems there isn't any Database documentation for a given collection in TFS 2017 - e.g. DefaultCollection.
I can get WorkItems from dbo.vw_WorkItemCoreAll & dbo.vw_WorkItemCustomAll, but I can't seem to join on the AreaID that is given to tbl_Area.
What am I missing?
It appears the joining has changed for TFS 2017.
In general I would recommend using the TFS_Warehouse, if the database must be used at all. Areas in TFS_Warehouse are much more straightforward than the TFS_[YOURCOLLECTION] Database.
That being said, if you must use the actual raw database, then here's a query that will join the necessary info:
SELECT * FROM dbo.vw_WorkItemCoreAll w
INNER JOIN dbo.tbl_ClassificationNode c ON w.AreaId = c.Id
WHERE
id = SOMEID
ORDER BY w.Rev DESC
It appears that tbl_Area doesn't contain the actual classifications used for WorkItems anymore.
Disclaimer: This is a last resort - the MSFT preferred mechanism for obtaining this info is the TFS REST API, for the usual API reasons (flexibility, reproducibility, etc.).
In this case I wanted to run an SSRS report (didn't care if it broke in a few months), which works better on raw DBs.
If I pull up a task for a particular project there is a field called original estimate. The only place I can find the original estimate is in the Tfs_Warehouse database in the FactWorkItemHistory table under the Microsoft_VSTS_Scheduling_OriginalEstimate column.
Can someone clarify how this value works? The reason I ask is it changes in the FactWorkItemHistory table for the same task. There are some positive entries and negative entries. If I sum up all of the Microsoft_VSTS_Scheduling_OriginalEstimate values by Task and ProjectNodeSK I come up with the amount that will be show up in the TFS task UI. I'm just wondering why the value changes over entries. In fact, I also would be curious as to why there are multiple WorkItem entries for the same task. I figured (incorrectly) that the WorkItem table would be a one to one as far as the Task in the TFS UI goes.
Because it's a data warehouse. It's showing you how the value changed over time, not just a snapshot of the current value. This enables deeper reporting on trends.
I am getting started with TFS 2015 and I need to know how to make a query that returns all of the work items for the current iteration for the current team. I have Iteration Path Under #CurrentIteration and Work Item Type = User Story, but I can find a macro similar to #CurrentIteration that would get the current team or team area. How do I filter out the stories for all other teams?
It's not able to do this through a query. You could check the Query macros or variables, use the macros described in the following table to filter your queries based on specific fields. There is not any team area related macro.
Besides, actually as far as I know work items can only be assigned to specific people not groups. However, for a workaround. By assigning a work item to a specific area path you basically assign it to a team. If you use the area path for something else today, you can also use another string field in the work item that specifies the team.
(https://www.visualstudio.com/docs/work/scale/portfolio-management)
So you could use Area Path to do the filter.
This won't directly solve your problem but you can use 'Assigned to' 'In Group' and then use a user group e.g. '[Home]\Team NI'. This will return tickets assigned to the group or group members but assumes the tickets are assigned appropriately (rather than being unassigned). YMMV but I've found it useful at times to get around this limitation. TFS Azure 2019 now also includes #TeamAreas - which is helpful unless you have multiple teams using the same areas.
MS Access 2013
Office 365 Sharepoint Linked Lists
I have two tables in a Desktop Access application that uses Sharepoint Linked lists.
Equpiment
Equipment WorkOrders
I'm trying to create a Report where the user can print the details of a specific WorkOrder, and then in a subreport list All Work Orders associated to that specific Unit.
This sounded simple enough, I created a Query using the WorkOrder and Equipment Table to collect all the data I needed to print for the primary report, with Criteria WHERE WorkOrder.ID = 200
Then I create a second query on the Work Order table for the subreport. I linked them by the Unit # so the subreport will print a list of all Work Orders for the specific Unit of the Parent Report's.
Now this works fine for a single Record it will print the Work Order and Unit Details of the selected WO, and the subreport will print the entire list of Work Orders.
Where it starts glitching is when I try to print multiple Work Orders eg: Criteria: WHERE WorkOrder.ID = 200 Or 250 Or 261
Now the Master Query works perfectly, when run on it's own it will pull up 3 records (where the ID = 200, 250, 261).
But when I open up the Report it will start with the first Page displaying all details for WorkOrder 200, but then when I navigate to the next page instead of printing off WorkOrder 250 (Like you would expect considering there's only 3 records in the Query, and then the 3rd should be 261), the next record becomes WO 2, then 3,4,5,6,7,8,9,10..etc) The report prints off the entire Table (except WO ID 1).
Why would this be happening? It doesn't make any sense to me.
Another thing that confuses the situation is I have a development application that uses Imported Local Tables that are identical and the system works perfectly with those tables, it's only with the Linked Tables does it break.
And another thing to note is the Work Order table has an ID field Autonumber, and a WO (string field), the WO field 99% of the time equals the ID field (In some cases it does not), if I use WHERE WO = "200" Or "250" Or "261", this works, but I can't use this field because that field doesn't always equal the ID and isn't always unique
The solution to this issue was to use SELECT DISTINCT, which eliminated the selection of all Records