Service anniversaries today with SharePoint using calculated fields and filters - date

I need to create a view that show employees that have their Service anniversary today.
I am familiar with the problems with using [Today] in calculated fields but still thought that this was a straight forward thing to do.
I have a list with a [Hire Date] field.
In that list I have created a calculated field [Hire Date - mmdd] with the formula =TEXT([Hire Date],"mmdd").
With this someone hired 15 years ago today will for instance get the value 1115
This works fine. So far so good.
Next step is of course to create a view in order to list employees with Service Anniversary today - knowing that [Today] is allowed in filters.
I create a view selecting all employees with [Hire Date - mmdd] is equal to TEXT([Today],"mmdd")
But it does not work !!!
Why does this not work when [Today] is otherwise working fine in filters.
BTW: This is SharePoint 2007

It doesn't work because you can't put anything other than very basic calculations in filters.
The filter is looking for records that have
[Hire Date - mmdd] = "TEXT[Today],'mmdd'"
without doing the text calculation turning TODAY[xxxxx] into "1115"

Related

Query/filter by 3 AND criteria + countif

I'm trying to create a dynamic dashboard for tracking student attendance patterns. When you choose the student from the drop-down in cell C4 in the Student Tracker, the data and charts all change dynamically. The way I've created dynamic charts is by "hiding" queries and other calculations behind the charts and making the text the same color as the background so that they aren't visible. Here's a shared copy of the dashboard with anonymized data: https://docs.google.com/spreadsheets/d/1nyI6h8aiPcJiqPIDWE6AsmCIPt_Vhj0dHdKtmsoqfuk/edit
I'm trying to create a chart that will show monthly patterns for the selected student, looking at the percentage of times they were marked "Present", "Excused absence (E)", etc each month (very similar to the days of the week chart).
This is the formula I tried:
=Countif(Query(ATTDATABASE!$A$2:$M,"select E,G,I,K,M where C='"&$C$4&"' and B >= date '"&TEXT(8/1/2019,"yyyy-MM-dd")&"' and B <= date '"&TEXT(8/31/2019,"yyyy-MM-dd")&"'"),"Present")
It keeps counting 0, even though I know the selected student was marked present in August. Even if I take out the other columns and just leave it as "select E...", it still counts as zero, even though I know the student was marked present on a Monday (column E) in August. I know there's got to be a way to do this, but my Google Sheets chops just aren't quite strong enough yet to figure out the magic combo/syntax.
try:
=COUNTIF(IFERROR(QUERY(ATTDATABASE!$A$2:$M,
"select E,G,I,K,M
where C='"&$C$4&"'
and year(D) = 2019
and month(D)+1 ="&MONTH(LEFT($G20, 3)&1))), "Present")

filemaker pro 16 creating records that share a date (work rota)

I am currently trying to create a rota within filemaker 16 and I can't figure out how to create records that share a date.
I want to be able to have people assigned to jobs and jobs assigned to dates but currently when I create jobs with the same date it creates a new record instead of assigning it to the one already existing.
I have 3 tables currently jobs, date and people. I have a 4th layout with a portal where I wanted to view records related to jobs that are set for a certain day.
Any help would be much appreciated.
Many thanks.
I am not 100% convinced you need a Dates table. Do you have anything specific to record about a date, other than its existence?
However, you certainly need a join table of Assignments, with fields for:
PersonID
JobID
Date
(this is assuming your rota is daily, otherwise you will need to indicate the shift or hours too).
I think your structure should change on this.
So instead have:
Parent:
ProjectId
Date
PersonId
JobId
Date
Then make the project Id your 'Primary Key' so your parent record.
Then you are just assigning the person, job & date as the child.
That way you can always add to the previous record without relying on date field.
You could then filter via dates etc.

Have Max value of range of dates filter be todays date

I have a "Range of Dates" filter and what I want is for the max (or right most value) to always be the most recent date which should be today's date. What seems to be happening is that if I leave the dashboard open and come back the next day the max value is yesterday's date and I must manually move the slider over to be today's date. How can I accomplish this?
I find a calculated field is the best way to do this as I have run into the same issues using the out of the box max date filter.
Create a calculated field as follows:
[date] = {FIXED: max([date])}
This creates a True False field where only the records that have the max data and carried through.
Now drag this onto the filter pane and select 'TRUE'.
I've generally seen two basic approaches for this problem: Calculated fields and relative dates.
Use a calculated field or parameter or some combination of calculated fields and parameters with filters. This is similar to what smb suggests in their answer to this question. It also seems to be the most popular approach.
If you don't particularly care about being able to set the end-date with the slider, you could try using relative dates, using the approaches detailed in the accepted answer to this Tableau forum question and in this Tableau Knowledge Base article. Jennifer Vonhagel also gives a second answer to the Tableau forum question farther down that uses a parameter plus calculated field approach.
Additionally, this Tableau Knowledge Base article offers another option (Option 1, in the article) if you have Tableau 10.3+: You can use the "Latest Date Preset" (see here for details) check box in the date filter dialog box. I haven't used this, but it looks promising if you're using Tableau Desktop (seems like it wouldn't work for Tableau Web). The article's Options 2-4 are just riffs on calculated fields, in my opinion.
Two more approaches I've heard of – but never personally seen in the wild:
Push the max date down into the view you put Tableau on top of and let the view do the work.
Use a script to modify the Tableau workbook's XML.

Tableau Aggregation of Groups over Fixed Level of Detail

For some reason when I try to group a field created by a fixed level of detail groups containing more then one item disappear from the view.
The basic set up is that there are 'unique event IDs' which are RCIPID which have one or two dates associated with them (some events have two separate dates that are non-linear). There is a 'follow up' date which is tied only to the event location and not the RCIPID, but each RCIPID has only one location.
I've joined the 'follow up' data to the main file based on the location. The below computations [NTC Submission Date] is the date of the event. [Live Date] is the date of the followup. The computations correctly give the number of days after the event that the follow up happened.
However when I try to do a unique count of NTC Date (Or RCIPID) and then group the computations any group with more then one day disappears.
FP - Straight Diff
DATEDIFF('day', [NTC Submission Date], [Livedate])
FP - Remove Negatives
IF [FP - Straight Diff]<0
Then DateDiff('day',[NTC Submission Date],TODAY())
ELSE
[FP - Straight Diff]
END
FP - Days after NTC
{FIXED [Rcip Id], [NTC Submission Date]: MIN([FP - Remove Negatives])}
It works when it is not grouped together
But as soon as I group it all of the groups with more then one day disappear.
Any and all help is greatly appreciated. I think it has /something/ to do with being a dimension, but I honestly don't know what.
The goal is a bar chart similar to the second one, but with the groups "4-5 Days", "6-10 Days", "11-20 Days", and "Over 20 Days" visible. Those values do exist in the data and if I change the view to show the day instead of a count it shows the proper calculations:
EDIT: Using a calculated field instead of groups did not work. Trying a concatenated RCIPID and NTC Submission Date also did not have an effect.
I'm not a huge fan of the group by feature in Tableau as it has give me some unexpected behavior in the past.
There are a few approaches I would recommend trying. One is spelled out well here by using the bin functionality built into tableau. https://community.tableau.com/thread/188952
It sounds like you have some irregular bin sizes you're looking for, in which case you could create a separate calculated field with a series if else statements based on the range of [FP - Days after NTC] and assign a string to each 'grouping'
Lastly, I've not done an LOD of this style with two dimensions "FP - Days after NTC". You only appear to have COUNTD(submission days) on the view shelf. I would verify that you are getting the results you are expecting. And if not, you could create a separate calculated field that is a concatenation of [Rcip Id] and [NTC Submission Date] on which to based your LOD calculation, and then you can use COUNTD on that new field.
EDIT: It was suggested to try using a computed field instead of a group and/or concatenate RCIPID and NTC Date. I tried both and neither affected the result.

Drupal 8 contextual filter for date

does anybody know how to implement the view with contextual filter on date/time value? I have a content type Event with date field within it and need to somehow filter items within specific month. Not sure if it can even be done without special programming and if so, whether via that contextual filter (like node/) or maybe via exposed filter with list of months so user can filter items by himself??
Thanks
TC
There exists the contextual range filter module.
https://www.drupal.org/project/contextual_range_filter
To the time I am writing no Drupal 8 version is shown on the module page, but there are some. Have a look in the release section "View all releases". There you can filter the API version "8.x".
You can have a look into the README.txt for all the possibilities to query.
http://cgit.drupalcode.org/contextual_range_filter/plain/README.txt?id=refs/heads/8.x-1.x
A simpler solution could be to use the build in function in views
You can add special fields in the contextual filters section
They are called:
Created year
Created year + month
Created week
Created month
Created day
Created date