Show data based on selected date - QlikView - date

I have a list box of dates and a table which has datetime as dimension. The dates from list box is a separate table from that with complete date. I tried connecting them by cutting the datetime into just date (another field) in my select script but did not work. So I thought this should be done on the conditional of datetime dimension but I'm not sure how to do this. How should I be able to show data based on selected dates in Filters?

I would recomend two different approaches, recomending the first one :
On the LOAD script, along side loading the DateTime field, loading the same field again with only the Date part and use than one for filtering. Something like :
LOAD
<... some fields ...>
DateTimeField,
Date(Floor(DateTimeField)) as DateTimeFieldFilter
<... some more fields...>
Add a field selector for you DateTime field, then to Properties, Field dropdown and choose the last option "Expression". On the Expression box enter Date(Floor(DateTimeField)).

Related

Query date range for date saved in a text field in IBM Notes and Domino

There is a date saved in a text field. I'm trying to get documents collection when the field is in a date range using db.FTSearch method. But > and < doesn't work in a text field. Are there any way to convert text field? I'm not familiar with IBM Domino and have tried #TextToTime but doesn't work.
A few ways:
use db.Search instead of db.FTSearch; the syntax is completely different though, plus it is rather slow, but if you have to execute your query once per day or even less, you're fine
write an agent that converts the text date fields into new real date fields, so you can do your FTSearch; make sure you adapt the form used to create the documents, so that it also creates those date fields
use a view, where the first 2 columns contain the date value of your text fields, and sort the view; you'd have to use getDocumentByKey (but I'm not sure this works)
Your date is stored as text, so you need to use #TextToTime().
I.e.,
FIELD #TextToTime(field1) >= [01/01/2018] AND
FIELD #TextToTime(field1) <= [01/19/2018]

Changing filter type

My date filter looks like this
but i want it to be a dropdown menu like this
how do i do it? these are the only formats i can select
When creating the filter you must choose discrete dates instead of continuous. then you will have the option to display it as a dropdown menu.
This type of filter looks like this null column to add so drop down is not shown.so update the year values and got the year in show filter and then select the single value drop down. and edit the name in select year to show the drop down menu.
The answer by Littly will work,
One more suggestion is to create a small calculated field called year of Date -
which says -
YEAR(Date)
Put this new field in the filters and click on show quick filters and then you can select drop down and get the desired result.
The reason why this works is that, your field is now either a String column or an Integer column, it will be easily converted to drop down as compared to dates.

Tableau - Filter/Parameter For Different Date Ranges

I am trying to set up a filter or parameter for different date ranges in Tableau, such as:
Previous Week
Previous 4-Weeks
Previous 8-Weeks
based on the most recent data in the database. Is this possible?
Edit:
I should have been more clear here.
Is it possible to only have these options in the filter and have it based on the maximum date in the database?
Update
Based on your comment and updated question, you can do it as you intend, though it isn't as straight-forward.
NOTE: I did this very quickly and with a random data set, so it will be important for you to test this thoroughly with your data set.
Steps:
Create a parameter control that the users will use to change the selected date range. I created this as a list of strings with values that I can use directly in a calculated (after simple casting):
Create a calculated field that you will use as a filter that references the selection of the parameter control. It tests to see if the difference (in weeks) between the maximum date in the view and the date of any given row is less than the value of the parameter.
Calculation: INT([Date Filter Parameter]) > DATEDIFF("week",ATTR([Date Field]),WINDOW_MAX(MAX([Date Field])))
Place the calculated field in the filter box and set it to True.
You will be able to filter your data like so:
Original Answer
Yup - that is built into Tableau.
Add your date to the filter and select the "Relative Date" option:
You can set the defaults - users can change these later:
Then just "Show Filter":

drupal views difference between two dates

I want to create a view in which there are two fields start date and end date. I want to display one more field that is (difference between the start date and end date).
All this three fields should be displayed in table format.
So please tell me how to find difference between two dates using views?And i want to display this difference between the date fields as third column of the table.
You can try with Computed Fields. It allows you to define a new dynamic field for any content type (stored in database or computed on the fly), and you can code in PHP the value for this field, using other fields values.
Creating a computed field to store two dates fields difference is one of the example in the module doc :
https://www.drupal.org/node/149234
Then in your view you just have to display the computed field (and the two original fields).
Views PHP can do the trick as well, it allows you to create a new field within a view, which will be computed in PHP. You can use other fields values to calculate its value.
But I would recommend Computed Fields, Views PHP can be a performance killer.
Good luck

Can't group by year from a date row

I have a field of date-time type. I added this field into a view and formatted the date-time field to show only year. When I switch 'aggregation' on in Views and try to group this field it didn't work as i expect and show all the dates again. I saw the Vies-query and there wasn't any preformatting. It was grouping by dis field only. I want the modify the query to get this fields formatted as I need (years only).
Yes, it seems the aggregation settings work on the query, vs on the results that are output that you've formatted differently.
Here's how you can do the aggregation though:
Select the 'Settings' next to the 'Table' format
Select your date field (that you only show the year on) under the 'Grouping field Nr. 1'
Then just exclude that field from the display, since it'll be output at the top in the group
And here's what the result will be like roughly (for table view... you can try a variety of different ones like lists, etc and style however you like with css). I'm only outputting the title field for mine
Anyway, hope this helps!