Can we show values from two different timelines in one worksheet in Tableau? - data-visualization

My problem statement is described below :
I have a calculated field, say Opportunity. There is pre defined rule from organization, that the target value for current month will be 1/3rd of the value of 2 months back. For example, The target opportunity value for April will be 1/3rd value of February. I need to show the current month's opportunity and the targeted value in the same worksheet. How to achieve this is Tableau?
I am getting the base data from tables in Oracle through a custom sql query, and calculating the opportunity value in Tableau for each row, and then showing the sum for a range of time , say last 6 months.

The best way to do this would be to write the target value in SQL. It'll be easier (no need for data blending / complex calcs) and also more performant as it would be a hardcoded value in your dataset.

Related

QlikView Dynamic Date Comparisons

I’m relatively new to Qlikview and have a dataset that shows metrics by date.
This data spans two years and the requirement is to have a comparison/variance that is dynamic and can handle the date filters on the report.
For example if the user selects 2018 this field should show the current date compared to the previous year date. Similar for Quarters, months, weeks and weekdays.
Ideally it should always show for the previous period. They’ve had this created in Excel but it can’t handle the amount of records and I suggested QlikView as I had created some other Dashboards in it.
I have tried set analysis though I struggle to see how that would fit into one expression.
Any thoughts would be appreciated!
I would say you would need two expressions, one without a set analysis (that would be filtered by your current selection) and one with a set analysis to guarantee that you only get today's value. This would be something like :
Sum($<[Date Field] = {"$(=Date(Today(), 'DD/MM/YYYY'))}>} [Value Field])
Check the date format conversion to see if it matches the date format of your field.

VBA - Graph by month

I am having issues trying to create code to make a graph that is dependent upon months. So I have Column A which is the beginning of the week date, i.e. 1/1/17. In Column B I have the count from that week of issues occurred. I would like to group together the count by month, using the Month function, so for January there are 37 issues, February - 23, etc. And then make a graph accordingly where the first month is titled January.
Eventually, I would like to similarly do this on a quarterly basis as well, but any help with the monthly issue first would be greatly appreciated. Here is a screenshot of the data which is located in Worksheets("Report").
First off, format your data as a table since that will make your life much easier. You will need to add headers to each column. This will make your data easier to read, and easier to maintain.
To format it as a table highlight the range, and then press CTRL+T. Make sure to check 'My data has headers'.
Good, now click inside the table, Insert > PivotTable. Select the destination. For rows you want Date, for values you want Sum of Value (where value is whatever you name your values column.
Then finally, check out this article for the whole rundown of Groupby: http://www.contextures.com/xlPivot07.html.
To be fair, there is an easy enough way of doing this without a PivotTable (adding a helper column for Month for example), but there's no need to reinvent the wheel. Additionally, if you want to add Qtr. eventually, you're better off familiarizing yourself with workhorses of excel.
Lastly, once you have taken the above steps, you'll likely find the Timeline slicer very helpful. You can use that to visualize specific periods on your pivot or chart.
Minor Note: This all assumes your dates are true dates. If they aren't, you'll likely run into more issues.

Conditional cell formatting on SSRS pivot table

I created a pivot table in SQL that has report names along the left side, and hours (00:00, 00:01, etc.) along the top. The values in the table are the number of times each report has been used during that hour over the past three months. I've imported the table into SSRS, and I'm trying to create a heat map of sorts. I want to color the cells darker or lighter across the row based on the number in each cell compared to the value of cells across the row (cell that has the highest value will be the darkest colored).
I've tried following this guide to color the cells, but here the entire row is one field, while I have separate fields for each column. Is there a way to achieve this?
EDIT: Added picture of table design, and preview where coloring is done incorrectly
I understand your problem better now...The function uses the min and max values of a column to determine the range from lightest to darkest, then it probably looks at what fraction of the range your actual value is. In your case where you have each column's data coming from a different cell it'll be a pain unless your columns are fixed and even then it's more trouble than it needs to be.
I would suggest the following.
DON'T PIVOT your data in SQL, we can do that really easily in SSRS, your dataset will be simpler too something like
ReportName Hour UsageCount
ReportA 0 8
ReportA 1 4
ReportC 22 18
and so on...
Create a new report and add a matrix with reportName as the row group and hour as the column group. The data values will be UsageCount.
That's it for the report design, then just set the cells back ground based on your function but this time you can pass in Max(Fields!UsageCount.Value) etc as per the sample.
I've rushed this a bit so it if not clear, let me know and I'll post a clearer solution.

Derived date calculation

I am currently entering data into a SQL Server database using SSIS. The plan is for it to do this each week but the day that it happens may differ depending on when the data will be pushed through.
I use SSIS to grab data from an Excel worksheet and enter each row into the database (about 150 rows per week). The only common denominator is the date between all the rows. I want to add a date to each of the rows on the day that it gets pushed through. Because the push date may differ I can't use the current date I want to use a week from the previous date entered for that row.
But because there are about 150 rows I don't know how to achieve this. It would be nice if I could set this up in SQL Server where every time a new set of rows are entered it adds 7 days from the previous set of rows. But I would also be happy to do this in SSIS.
Does anyone have any clue how to achieve this? Alternatively, I don't mind doing this in C# either.
Here's one way to do what you want:
Create a column for tracking the data entry date in your target table.
Add an Execute SQL Task before the Data Flow Task. This task will retrieve the latest data entry date + 7 days. The query should be something like:
select dateadd(day,7,max(trackdate)) from targettable
Assign the SQL result to a package variable.
Add a Derived Column Transformation between your Source and Destination components in the Data Flow Task. Create a dummy column to hold the tracking date and assign the variable to it.
When you map the Excel to table in a Data Flow task, map the dummy column created earlier to the tracking date column. Now when you write the data to DB, your tracking column will have the desired date.
Derived Column Transformation

Time column average in access database

I have an access database one table has time column that shows the total time from (endtime - starttime) I need to have that column averaged (hh:mm) ss not needed. I need to store this average into another table, and then be able to display that in a textbox. with conditional formating as far as color for certain time ranges. I'm going to need to do this for a daily range and a monthly range, just wonder what would be the best way to accomplish this. this monthly and daily average will need to update each time the table has records added to it.
My thoughts on this was pull the daily times into an array, then average the array, and store that average in another table. Then use the daily average table to display in a textbox, along with the conditional formatting. and then the same thing for the monthly time average as well.
It is by no means difficult to obtain this information from a query, time is just the decimal portion of a number.
SELECT Format(Avg(CDbl([Atime2])-CDbl([ATime1])),"hh:mm:ss") AS Diff
FROM Table;
Or
SELECT Sum(DateDiff("n",[ATime1],[ATime2])) AS SumMins,
Count([ATime1]) AS CountRecs,
Avg(DateDiff("n",[ATime1],[ATime2])) AS AvgMins
FROM Table;
Furthermore, MS Access 2010 has data macros and calculated columns that are good even outside of Access.
Finally, it is not generally recommended that you store a value that becomes invalid at every edit when the value can easily be calculated.