I have a button that when it is clicked I want it to select the last 14 days. This means that if today's date is 2014-03-12, I want it to select all dates between 2013-02-26 and 2014-03-12.
I have a time_table with the fields KEY_timestamp (yyyy-mm-dd), year, month, day.
In my button I have an action Select in Field, with the field KEY_timestamp and I have a Search String which looks like
=if(
now() - 14 < KEY_timestamp,
KEY_timestamp
)
Now, to tell you the truth I have no idea how to go about this, and my experience with Qlikview is limited at best... I hope somebody can point me in the right direction. I tried Googling this but I've been unsuccessful so far.
In the search string type only this line:
='>' & date(now()-14) & '<= ' & date(now())
If it didn't work properly, add this line in your script:
date(KEY_timestamp) as KEY_timestamp_formatted
and then replace your select in field with the new column
Related
I want to show all dates onward when searching dates. For eg. i searched 2012-12-24, all dates going forward will appear.
Here's my query right now that can search the exact date only and not including date onward.
SELECT *
FROM user u
where cast(u.start_date as varchar) = '2012-12-24'
Use an inequality:
SELECT *
FROM user u
WHERE u.start_date >= '2012-12-24';
i'm trying to select a date range (from date and to date) from a datepicker
I need to make many search, for example:
from 12/03/2022 to 19/03/2022
from 19/03/2022 to 26/03/2022
from 26/03/2022 to 02/04/2022
etc etc
If i use xpath and click on the days i need to search it work, but i prefer (if is possibile) to write in the field text 2 dates (arrivals and departure).
It's possible this solution?
Is possible to write on 2 field text, but if i try i do not why the return date not work.
It seems it work only with a click on the day.
Thank you
I'm making an excel file that will be used for a report on sickness absence.
We are looking at the last 100 days (which I've been able to do with a simple filter in my Applied Steps) and we want to compare to the same time last year plus 100 days before that date AND look at 50 days after that date.
How can I filter for this in Power Query? Or do I have to write a custom formula? (In which case, does anyone know what and where to write it)
Idea is to be able to run this report every day/week and give updates on how we're doing in the winter in comparison to last year.
Any help on this will be greatly appreciated, thank you in advance!
Use the drop down filter atop the date column ... Date filters ... between ... and enter some random set of dates like 1/30/2019 through 1/30/2020
That generates this code
= Table.SelectRows(#"Changed Type", each [date] >= #date(2019, 1, 30) and [date] <= #date(2020, 1, 30))
edit it for your desired date range which could be like this
= Table.SelectRows(#"Changed Type", each [date] >= Date.AddDays(targetdate, -465) and [date] <= Date.AddDays(targetdate, -315))
I assume -465 which is last year (365 days prior) plus 100 days back, and -315 which is -365+50
As for what to use instead of targetdate ... you didn't tell us .. perhaps hardcode a date #date(2019,10,31), use whatever you had in your original filter, or maybe the maximum of the current date column
List.Max(#"priorstepname"[date])
I have one vertica query in my tableau,
select * from mytable where Date(sometimestamp) between
start_date and end_date
As you can see data varies as per change in date range.
My issue is to set start_date as default to current_date - 90 and end_date as current_date.
There is not issue in making end_date as current_date but no idea about how to set start_date as current_date-90 in tableau.
I tried making calculated fields etc but none helps.
Could you please guide me on how to do that.
Note - Both, start_date and end_date should be calendar component not dropdowns or slider.
You can accomplish this by adding a filter to your data source -- note that you won't be able to control this filter from the dashboard (if that's what you want to do, you'll need to create a calculated field and let the users interact with it), rather, this is a datasource level filter.
Go to the data source and click "Add" under the filters text in the top right, then click "Add"
Click the "Relative dates"
Then, select Relative Dates, Months, Last 3 (Or select Days and enter 90 under the "Last" radio button) and press OK.
You said you have the end date handled, but you can create another data source filter to handle the end date if you want.
I'm a novice to Tableau, not going to lie. But for the life of me I can't figure out how to pull data from a table that's greater than thirty days old.
Basically, I have a set of work orders, and I'm just trying to get the count of the total work orders that are open AND older than thirty days. How would I go about doing this? I feel like it's a lot simpler than I'm trying to make it out to be.
You will have to create a calculated field and filter on that.
right click on your date field choose Create/Calculated Field
Use this formula, with [Date] being your date field: TODAY() - [Date] or, more flexible DATEDIFF("day" , [Date], TODAY())
give it a name eg. datediff
drag and drop datediff to the filter shelf, choose "all values" and set the range, for you 0-30
That should do the trick.
You can use your date filed as a filter and choosing the relative filter format.