How to Display a single Date in Google Data Studio? - date

I want to display a single date dynamically in Google Data Studio. e.g. I want to display last Monday's date whatever it was e.g. 09-11-2020 and it would change to 16-11-2020 as the Monday 16-11-2020 would pass and so on.
I have a connection with BigQuery and I can connect from there to bring the date dynamically from BigQuery as:
SELECT DATE_TRUNC(DATE_ADD(CURRENT_DATE(), INTERVAL 7 day), WEEK(MONDAY)) as coming_monday
&
SELECT DATE_TRUNC(CURRENT_DATE(), WEEK(MONDAY)) as last_monday
So calculating dates isn't a problem as they are being received in Google Data Studio, however, I could not display them appropriately using any of the Google Data Studio tools like Text, etc.

Dates can currently be displayed in Google Data Studio Scorecards; in addition, the Calculated Fields in the question could be recreated by copy-pasting the below into the respective Scorecards, aggregating by MAX or MIN (which would display the same Date in this scenario) and then setting the Type to Date (Default: Date & Time):
1) Coming_Monday
DATETIME_TRUNC(DATETIME_ADD(CURRENT_DATE(), INTERVAL 7 DAY), ISOWEEK)
2) Last_Monday
DATETIME_TRUNC(CURRENT_DATE(), ISOWEEK)
Editable Google Data Studio Report and a GIF to elaborate:

It cannot set single dynamic value with straightforward way as text in GDS now.
But, you can use normal Table tool of GDS with single row, and it will show as single dynamic value that you need. Scorecard can also be used.
Here is how-to of using Table.
Under Data menu, set the date column that you want to display in Dimension, and do not set Metric. Also, choose Rows per page as 1.
Under Style menu, uncheck the Show header checkbox, Rows numbers checkbox and Shows pagination checkbox.
When you view the report, it will show as text.

Related

Tableau dashboard filter action excluding date but including clients represented in date clicked

I have a bar chart below that shows the sum of clients by month. I want to be able to click on a month and use a dashboard action to navigate to all data for each of the clients represented in the month that was clicked. Basically, I want to exclude the date portion of the filtering.
I currently do this by navigating to a sheet that includes client_id and filters for the single month and then I select all client_ids and action to another sheet that filters by the selected client_ids and not date. I want to remove the middle step.
If the above selected month is April 2020 and represented 64 clients, my current action takes me to a sheet that has each client on a row and shows me their sum of invoices for April 2020. I want to see those same 64 clients for all months they have transactions in.
This one may be tough to accomplish, but I definitely see what you're setting out to do. If you're using a date dimension on your action it will use that data to filter.
However, there may be some other options depending on what you're needing. If don't need to see the invoice ids and only want to see the sum of invoices for all months you could use a LOD (Level of Detail) calculated field.
You would create a calculated field like:
{ FIXED [client_id] : SUM([your invoice amount measure])}
Use this as a new column to get the sum of all invoices in your data set for each client.

Get full date range of linked field in tableau

Gif of problem
I am currently working on a dashboard in tableau, which shows the count of New-User-Signups and Interactions side-by-side given different date windows. The first New-User-Signup happened before the first Interaction, and the last Interaction happened after the last User Signup.
In order to choose a date window, I linked the date fields in both data sources, and made a date filter, which I applied to all worksheets using related data sources.
However, depending on which "date" field I choose, (from the User Signup table or the Interaction table), the "All Dates" option of the date filter only goes from start to end of that data source's date range.
No matter what I try, I exclude some entries in either one graph or the other. How can I make the "All Dates" filter go from the minimum first date between both data sources, to the maximum last date between the two data sources?
I run into this issue a lot with the data that I use. The problem is that the filter will only be able to contain dates that are in the dataset it is created off of, even if you link the data sources. When I run into this issue, I use parameters instead.
You can find instructions here:
https://kb.tableau.com/articles/howto/creating-a-filter-for-start-and-end-dates-parameters

Query on Tableau Dashboard

I am a new to Tableau and having some issues with it.I am Using a parameter to filter month data across Sheets connected to different Data Sources.
I want to Filter Current Month Data Automatically when the dashboard starts.
Can anyone guide me on how to do it.
Thanks in Advance.
T
Introduced in version 10.3 is a feature called Latest date preset. The release notes say "Start with up-to-date data. Set filters to display latest date values automatically, as soon as your workbook opens." Create a filter that spans applies across the data sources and use this new setting. The setting is in the filter dialog.
See https://www.tableau.com/new-features/10.3#tab-analytics-2
The critical aspect of your question is that you are filtering multiple data sources using a parameter. Given that, the most straightforward approach is to define a boolean calculated field in each data source, called say Within_Date_Range.
Each of those calculated fields should compare the appropriate Date field in that data source to the selected parameter value and return true or false to indicate whether the current record should be included in the query. (Parameters are scoped to the workbook and visible from all data sources)
Place the [Within_Date_Range] field for data source X on the filter shelf for the worksheets that use that data source X. Check the true box of course.
Now when you change the parameter, all the worksheets filter accordingly.
Alternatively, you can abandon the use of a parameter. Define relationships between your data sources using the corresponding Date fields (under the data menu). Show a filter control for the date field for one of the worksheets and set the scope to "related data sources"
Hope this helps!
Create a calculated field Date_Filter as
lookup(min([Your_Date_Field]),0)
Drag this to 'Filter'; select 'relative date' option and choose last 1
month (because you wanted to show just the current month data by default).
Right click this filter and select "Apply to selected worksheet" and
choose sheets in which you want this filter to be applied on the
dashboard.Viola!
With this solution you can very well see current month's data by default and can go back to as many time periods you want.

Excel - Insert "day" on a cell and format it to date with current month and year

I am working on a home accounting template (and could not find any good one :-/), so I am creating one for each month. Both in my expenses and my incomes, I would like to have a date column where I just have to insert the "day" (e.g.: 22) and it automatically fills the rest with the current month and year (or I could set them in another cell).
For example: 22 + ENTER would return: 22/12/2014
If I do this, I automatically get a default date: 22/01/1900
I do not know if it is possible to change this defaul date depending on the current one or any other value.
I have tried with a different strategy: if the amount column is not empty, fill in with today's date: =IF(A3="";"";TODAY())
The problem is that I do not always register today's expenses, so I need to change it manually. I was just wondering if this is possible and there is a better way (maybe a macro?).
You need Excel to modify the cell contents after you press ENTER. The only option seems to be a Macro using the Worksheet_Change event.
Please check out this other question. I think that will help.
This can be achieved with simple formatting and use of controls that are available in Excel. VBA will give you drastically more flexibility, however the request above can be accomplished without learning VBA.
I have included a sample file here.
Steps to recreate:
Create a range of months. I created a range including the current month through 12/2014
Insert a combo box from the developer tab. Right click and select Format Control. On the Control tab, input the range you just created and then select a "linked cell". This will insert an integer to indicate which item you picked in the list, starting at 1.
Use the attached formula to add the DAY that you enter in the first column and VLOOKUP the month and year from the value chosen in the combo box.
Enhancements: I used conditional formatting to change the text color of the days you enter to WHITE. This way you won't see them. I also included some checking in the VLOOKUP formula: the day you enter must be a number and must be non-blank for a date to populate.

Real time alert for JasperServer

I am having two input for dates as below & want to set alert for that
Alert:- If difference between StartDate & EndDate is more than 6 months,it must generate alert / prompt panel showing text "Month Period exceed than 6",
& report should not proceed further, untill & unless the user select dates between six months.
As far as I know you cannot configure this in JaperReports Server as is, you'd need to implement some logic around import control validation which might be rather complex given the fact that input control rendering is based on a single template and lots of configuration.
However, you can implement the desired validation easily in the report itself:
create another parameter datediff that contains as default expression the calculation of the date difference in months (the parameter needs to be specified below the 2 date parameters)
The way to utilize this information depends now on your particular report design, here an example:
extend your report query with where clause and 6>=$P{datediff}. This would only return results if the date difference is less or equal to 6 months
add the no data band to your report and add there the desired error message.
modify your report configuration for when no data to no data section.
redeploy your report to JasperReports Server.
The desired behavior is now available.