Superset Dynamic Time Range Filter - dynamic

How can I set the all filters dynamically with a time range filter in superset?
For example, when I choose the time range last 28 days, I want to see the data of the relevant column for the last 28 days. As far as I know, the existing filters show all the data of the relevant column and are not affected by the time range. (and that increases the query cost a lot.)
The first thing that comes to my mind is to set the column related to the time range to have a parent child relationship, but I guess it doesn't support parent child relationship with time range.
Can anyone help me how to solve this problem?

Related

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

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.

Auto-updating cell ranges based on date

I currently have an excel document with details of invoices on each row for nearly 5000 rows. These rows constantly have new invoices added to the bottom of them.
I am looking for a way to be able to assign the invoices that were raised within the previous month to a range prior to analysing them. There could be several invoices raised on the same day and they may not (although they should be) in order
The dates are within the first column of the workbook (A:A).
Having had a look around I thought I had come up with two solutions which created an auto extending named range but neither of them worked:
=OFFSET((DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)),0,0,COUNTA(DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)):(DATE(YEAR(TODAY()),MONTH(TODAY()),1),1))
and
=OFFSET((DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)),0,0,COUNTA(DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)):(DATE(YEAR(TODAY()),MONTH(TODAY())-1,31),1))
The reason that I am trying to get this to work with Name Manager and OFFSET is to use the named range within VBA so if anyone is aware of an easier way to do this within VBA that would also be great.

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.

Divide time column in time spans based on several columns

So far I have managed fine using Excel's formulas, so I might not need VBA to solve this problem.
I want to create time spans in column V based on the times in column O. The time spans are: 00-05, 05-07, 07-09, 09-15, 15-18 and 18-00. Thus far I have been using the formula (example for row 25):
=IF([#Old]="","",IF([#Old]*24<5,"00-05",IF([#Old]*24<7,"05-07",IF([#Old]*24<9,"07-09",IF([#Old]*24<15,"09-15",IF([#Old]*24<18,"15-18","18-00"))))))
But I want the time spans to be conditional on column M as well, so that fx the time spans for rows 41 to 42 should still be 05-07, because they are in the batch that started in 05-07 (row 31). I have uploaded what the result should look like in the picture below. I also have a column that counts the start and end of the batch (from 1 and upwards). This might help to solve the issue, but I'm not sure how to do the expand the conditional if-statement.
Try this (this works from cell F2, since other rows are being checked - M1 and R1 in this case, which have no simple reference in a teble-ish way):
=IF([#batch]<>M1,IF([#Old]="","",IF([#Old]*24<5,"00-05",IF([#Old]*24<7,"05-07",IF([#Old]*24<9,"07-09",IF([#Old]*24<15,"09-15",IF([#Old]*24<18,"15-18","18-00")))))),V1)
Basically I added an extra if to check if it is a new batch.
IF([#batch]<>M1,(do the long calculation), (use the same value as above))

Job/Work scheduler/planner for teams

Currently we use an excel spreadsheet with 4 tabs (as tab for each team), each tab is a planner/diary that week, each day has 4 "slots" for jobs that are planned in.
The people type in the information for each job into one of the 4 slotsfor the day. Each slot contains information in different cells; Job No., Address, Duration, Notes, etc...
The issue/time consuming aspect of this method is when jobs have to be moved about between teams or moved to a different day it involves lots of copying, pasting and deleting.
What I am trying to achieve is some form of drag/drop interface (similar to the way the calendar in Outlook works), where the people who use the spreadsheet can input details for the job in a form and then have a drag an drop "tile" to be able to drag into one of the "slots.
The data contained in these slots needs to be able to produce a report which is a linear list of all the jobs planned that week.
I am at a loss to figure out what method I should use to create this, it seems it is beyond the reach of Excel from what I can find, also beyond the reach of Access, so I suspect it will involve some form of programming. I have basic understanding of VBA, but that's about it.
Can anyone make any suggestions.
Thanks
Working with data in this format will always be hard and I would not reccomend adding any drag and drop until you have sorted out the structure of your data.
You might like to consider another approach, which involves restructuring your data to make it easier to work with...
If you had one sheet with the following columns:
Teamname
Date (instead of Week Number and Day of week,)
Timeslot
JobNo
Address
Duration
Notes
Etc
Then each row would represent a job and have details of when it is occurring.
This is way a database would store the information about the jobs that are happening.
To change when a job is happening, all you have to do is update the date (and timeslot) of the row.
You could then create another worksheet for each team that uses excel formulas to lookup jobs happening this week and display them in a column for each day - like you have now. These sheets would be for display purposes only.
(You would use formulas like VLOOKUP etc)
If you want to change the date of a job you then simply go to the worksheet with the long list and change the date.
Having your data in this long list (ie normalised) format will give you many benefits. For instance you can summerise the report of the data using pivot tables.
If you add filters to the long list (SEE Ribbon>>Data>filters) you can order the data and reduce the list to only show jobs on a selected date, or for a selected team etc...
This is definitely the way forwards. Having restructured the data in this way, you could then add flashy ways to change when a job is taking place by adding buttons on the team worksheets or something.
PART2:
So in you ling list I would recommend excel CONCATENATE function to add an extra column with the text you want displayed elsewhere in your "calendar". #COLUMNA
I would also create another column which is a unique identifier for the row. This will probably be the "Date in YYYMMDD format & timeslot in HHMI format" concatenated together.
In the calendar view sheets say you need a column to display each day of the week with a row for each time slot: You need to
enter a StartDate of the period you want to view
Set up a column for each day (with a formula to calculate the date of the day (ie StartDate, StartDate+1 etc). The date is displayed as a column header (perhaps with a format that shows the dayname, but is stores the date)
each row will have a column that has the timeperiod name and each row will have a value entered. The value is the same as those used in the long list's timeperiod column.
When a user double clicks on a cell you can use the worksheet event
Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
in the VBA code, for this event you need to:
see if the cell double clicked is one you want to respond to
if it is find the date and timeperiod from the corresponding column and row header.
use VBA to activate the long list sheet and probably filter to only show the jobs taking place that day or perhaps that week. Then select (or highlight?) the job that was double clicked.
This is quite easy once you know VBA.
There is a lot to know though I would:
use a named range to define the row with the date and another to define the column with the timeperiod
use a named range to define the cells that will respond to a double click
use range functions in VBA like intersection and the entirerow, entirecolumn range properties to find the date and timeperiod of the double clicked cell.
use the macro record to write the initial code that will do the filter.
adjust the code to be well written and to find the date and timeperiod as required.
Create a sheet for all departments? Or just create one sheet where the dept can be chosen.
You could get clever and allow the user to select two cells in the calendar and provide buttons that do things like:
swap the jobs
If they select many cells then a button to Goto the list and only show jobs that were selected in the calendar.
Perhaps the user could select one job and buttons could move the job back or forwards 1,2,7,14 days.
Note that you can use the long list to record other details of the job like time taken, customer, start time, end time etc...
See about Pivot tables here which might give you some ideas about how you can summarise you data to give info like jobs per day, total value of jobs by day, etc...
Before you tie yourself in knots using Excel, you should always consider using Access.... as with someone who know what they are doing, access will deliver a lot more in a shorter period of time and can do nice things like print one page per job etc etc...
(Do you need a contractor?)
mr#HarveyFrench.co.uk