How to compare two tables in data studio - comparison

I have two tables in data studio:
I'm asking the user to select two dates to compare two weeks. This way, we can see the two weeks' data side by side. However, I also want to see the percentages of change based on vendor. Is there a way to show this? Or how can I improve the comparison method ?
note: vendor name field is not fixed. it can change for every week.

Data Studio provides a way to compare current date with previous one, but the comparison parameter will be fixed (eg. "current week vs previous week", "current month vs 2 months ago"). That means you won't be able to drop a selector for your users.
With this feature you to select the current date (or a range of dates) and it will always compare to the period you choose in design view. (I usually select the option "previous period", so if the user select a week, the comparison will be with the previous week; if the user select a month, the comparison will be with the previous month).
To achieve this, just check this entry in the documentation.
Another limitation is that it will always display the difference between current value and previous value (delta). Currently, you can't change this behavior.

Related

Combining a dynamic total by state in Tableau

I am using a US shootings database where the event is specified by 3 columns, state event occured, date, total casualties. I want to make a dashboard in Tableau that has dynamic sum and sorting where if the year column was a page that I could click through, the graphic would reflect the top ten states of sum(casualties) of that specified range. So my data ranges from 1924-2022, and if I started the page at 1980, it would graph the top 10 states with the sum of totals between 1924-1980. The next page could potentially be a different top 10 of states and would reflect the current top 10 states as the sum(casualties) from 1924-1981.
I hope this makes sense. I apologize if it does not as I am just starting out. I did attempt to sort the data in python by making a column for each year, and you could move horizontally along a state to see it's totals change as each year goes by. Would it be best to add these year columns as a group and sort by top 10 and year that way?
Edit:
Attempting to click through the year filter and dynamically sort the graph by top 10 states with total shootings from 1924-current year
Can you use SQL to query the database? If so, you can insert a date parameter in the query that replaces the use of pages to calculate the sum based on the earliest datapoint to the year you have selected and then just click show parameter. When you create the parameter make sure you set step size to one year and switch the parameter to slider. You can also create a state parameter that is based off that column of data and then use it to filter the data in SQL. However, you may need to use a calculated field or SQL case statements if you want to change the granularity from all the states to one selected state.
I hope this helps you. If you need more clarification, please comment and I will try to provide an example.

Cognos - value prompt to display months from january to december

For a monthly report need to display the months January to December in the value prompt. Could you please advise how to achieve this.
Welcome Immi
I do not know what data items are available on the package you are using
However, you can create static values with a value prompt
Look in properties for the value prompt, static. Select the ellipsis
Then add the values
Depending on the version of Cognos, you can search the data items (worst case do this manually, maybe you will luck out and there is a query subject for dates). Look around and see if months is in the package. If they exist, add them to the value prompt query subject and give it a try
Also to consider, your take may require 13 month accounting, displaying the month name won't work in that case.
As far as value prompts there is a display value and a use value
The month name can be the display value and if you need for filtering the month #, that can be the use value.
https://www.ibm.com/docs/en/opw/8.0.0?topic=prompts-adding-static-choices-prompt

better design for fact table where each row has a Start & End Date

My fact table contains details for clients who attend a course.
To ensure i can get a list of clients registered on any particular day, I have not related the date dimension to the fact table.
Instead i created a measure that does basic between logic (where startDate <= selectedDate && endDate >=SelectedDate)
This allows me to find all clients registered on one single selected day.
There are a few drawback to this however:
-I have to ensure the report user only selects a single day, i.e. they cannot select a date range.
-I cant easily do counts for samePeriodLastMonth or Year.
Is there a better design i should consider that will still allow me to see counts of registered clients on any given day, along with allowing me to use SamePeriodLastMonth/Year functionality?
Would you mind uploading the structure of your fact and dim tables?
Just a thought bubble: if you would like to measure counts for a program over calendar years, I believe you would definitely need to create a Date dimension. Also depending on your reporting needs you might want to consider whether you need an Accumulating Snapshot Fact table.
Please find further details on this:
http://www.kimballgroup.com/2012/05/design-tip-145-time-stamping-accumulating-snapshot-fact-tables/
Cheers
Nithin

How to get TFS query result but for a previous date

Is it possible to execute a TFS query and get the results not for today but for a previous date?
I just want to see the results that were available in that date.
To clarify: I need to see the state of the work items on a give date to see their evolution over time.
According to your clarification, you need see the state of the work items on a give date. There is not a direct way to achieve it in Work Item Query.
You can only use Was Ever in Work Item Query to list items based on State past assignments, like:
state Was Ever Active
Or you can use State Change Date <= YYYY-MM-DD and State Change Date > YYYY-MM-DD to list all work items that changed State on YYYY-MM-DD. (Need to check whether TFS 2010 has State Change Date field)
Of course you can combine other clauses to narrow down the query.
What you want is actually the work item history. You need to get the work item history programmatically using TFS API. You can check this blog below to use the API:
http://www.codeproject.com/Articles/243653/TFS-SDK-Work-Item-History-Visualizer-using-TFS-API
I think you can create pivot table report to connect to TFS cube. For your requirement to see work items' evolution over time, you can define the pivot table as:
Check these two links for the details: https://msdn.microsoft.com/en-us/library/ms244678 and https://msdn.microsoft.com/en-us/library/ms244710.aspx

Find WorkItems that were assigned to X in the last 30 days

I'm trying to find all WorkItems that were assigned to a person X in the last 30 days.
The big problem I have is the "in the last 30 days"-part.
I thought about using the "ever" or "asof" keywords, but couldn't find a good answer yet.. something like WHERE [Assigned To] = 'X' AND (([Assigned To] != 'X') asof '<30daysago>').
But this is still not a bulletproof solution.
Any better ideas?
Thanks & kind regards
Simon
It appears that this is not possible using just WIQL, but you can get close.
The keyword #Today will give you today's date, then just subtract your range from it. The EVER keyword applied to [Status]='AssignedTo' and a comparison against a date 30 days in the past to [StateChangeDate] is what you'll need to accomplish this.
As close as you can get with WIQL and existing fields:
This says, from all revisions (status changes) return records where the user 'X' has ever been AssignedTo and the State has changed in the last 30 days. This will basically give you a slightly fuzzy picture of what your User has been working on in the last month.
WHERE [Microsoft.VSTS.Common.StateChangeDate] >= #today - 30
AND [System.AssignedTo] EVER 'Bennett Aaron'
ORDER BY [System.State]
Add the missing field:
You could add a custom field called AssignedDate that is captured during the New->AssignedTo workflow transition that you create in the Work Item Definition XML. You can accomplish this using the Team Foundation Server Power Tools extension to Visual Studio. This would give you exactly what you need as well as additional reporting options going forward.
TFS API
I cannot help you with this one, but I believe you could query using the TFS API.
A couple of quick gotchas I've experienced to save you time on ASOF and EVER:
AsOf won't help you by itself with this as it does not support a range of dates. It allows you to query as if it were another date. In other words, if you forgot to capture the results of a query yesterday, you can use an AsOf query to get the results that you would have gotten had it run yesterday. What I understand is that you want to query a basic date range.
EVER might not work as you expect against dates as I believe it uses the exact value of the field (timestamp portion of the date field would be included) it tests with. Just make sure the EVER keyword is used against the status field rather than a date.

Resources