Extbase: select child objects depending on date - typo3

2 Tables: seminars, dates, 1:n connection with irre (inline)
Is there a possibility to get all seminars in a list and for every seminar all dates which ar newer than today.
Getting all seminars with all their dates is easy. But i cant find a possibilty to restrict the child objects to certain conditions. And of course to sort them ...
Is there a possibilty aside from raw sql-queries?
Thanks
Petrer

Related

Need to group multiple fields together to form one group

Not sure if this is possible, but I thought I would put this out there and see what anyone thought.
Report: I need to track by classroom the parents that have given vs. those that I have not. I had created this awesome report with those that had, but I could never figure out how to pull the parents who hadn't yet in to the report. I need those that have not as well to create a sum and percentage of parents each class. (first query was too narrow, the next one gave too many dates and gifts, which duplicated the names in the report)
So I'm trying a different route and took the data from an Export instead of a Query, but now the "Classroom Guide" field is in a separate column for each child they have at the school.
I need to combine the 4 Guide fields somehow so I can group by them to create the classrooms in the report.
Makes sense?
Example data is like:
first.name;last.name;Guide1;Guide2;Guide3;Guide4;Gift.Date;Gift.Amount

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.

How to get all missing days between two dates

I will try to explain the problem on an abstract level first:
I have X amount of data as input, which is always going to have a field DATE. Before, the dates that came as input (after some process) where put in a table as output. Now, I am asked to put both the input dates and any date between the minimun date received and one year from that moment. If there was originally no input for some day between this two dates, all fields must come with 0, or equivalent.
Example. I have two inputs. One with '18/03/2017' and other with '18/03/2018'. I now need to create output data for all the missing dates between '18/03/2017' and '18/04/2017'. So, output '19/03/2017' with every field to 0, and the same for the 20th and 21st and so on.
I know to do this programmatically, but on powercenter I do not. I've been told to do the following (which I have done, but I would like to know of a better method):
Get the minimun date, day0. Then, with an aggregator, create 365 fields, each has that "day0"+1, day0+2, and so on, to create an artificial year.
After that we do several transformations like sorting the dates, union between them, to get the data ready for a joiner. The idea of the joiner is to do an Full Outer Join between the original data, and the data that is going to have all fields to 0 and that we got from the previous aggregator.
Then a router picks with one of its groups the data that had actual dates (and fields without nulls) and other group where all fields are null, and then said fields are given a 0 to finally be written to a table.
I am wondering how can this be achieved by, for starters, removing the need to add 365 days to a date. If I were to do this same process for 10 years intead of one, the task gets ridicolous really quick.
I was wondering about an XOR type of operation, or some other function that would cut the number of steps that need to be done for what I (maybe wrongly) feel is a simple task. Currently I now need 5 steps just to know which dates are missing between two dates, a minimun and one year from that point.
I have tried to be as clear as posible but if I failed at any point please let me know!
Im not sure what the aggregator is supposed to do?
The same with the 'full outer' join? A normal join on a constant port is fine :) c
Can you calculate the needed number of 'dublicates' before the 'joiner'? In that case a lookup configured to return 'all rows' and a less-than-or-equal predicate can help make the mapping much more readable.
In any case You will need a helper table (or file) with a sequence of numbers between 1 and the number of potential dublicates (or more)
I use our time-dimension in the warehouse, which have one row per day from 1753-01-01 and 200000 next days, and a primary integer column with values from 1 and up ...
You've identified you know how to do this programmatically and to be fair this problem is more suited to that sort of solution... but that doesn't exclude powercenter by any means, just feed the 2 dates into a java transformation, apply some code to produce all dates between them and for a record to be output for each. Java transformation is ideal for record generation
You've identified you know how to do this programmatically and to be fair this problem is more suited to that sort of solution... but that doesn't exclude powercenter by any means, just feed the 2 dates into a java transformation, apply some code to produce all dates between them and for a record to be output for each. Java transformation is ideal for record generation
Ok... so you could override your source qualifier to achieve this in the selection query itself (am giving Oracle based example as its what I'm used to and I'm assuming your data in is from a table). I looked up the connect syntax here
SQL to generate a list of numbers from 1 to 100
SELECT (MIN(tablea.DATEFIELD) + levquery.n - 1) AS Port1 FROM tablea, (SELECT LEVEL n FROM DUAL CONNECT BY LEVEL <= 365) as levquery
(Check if the query works for you - haven't access to pc to test it at the minute)

Using {{#each}} to fill a calendar with reservations: best practices

I'm building an html table with dates as columns and hotel rooms as rows.
I'm fairly new to Meteor and have had headaches over this.
Because a html table is build by rows, I need to iterate over the rooms. So, if I am not mistaking this limits me to choosing the following file structure in MongoDB:
Room Collection:[
{Room1:[{"31/03/2015", "2/04/2015",....]},
{Room2:["22/03/2015",...]},
...]
Before this I had a reservation object where every reservation had the name of the room in it. Because there is no way I can group these dates over different collections, I changed it to the above structure.
So, okay, now I am able to move the cursor from room to room and build table rows.
Bigger problem now is that I then would iterate over 7 days (lets just say, for now I only retrieve queries for the current week). If I now get three days back from the database that are booked. I am only able to loop three times. Which is bad news because I need to fill 7 td elements. So somehow I should Identify which days of the week are taken by the reservation.
Is it a possibility to just store every date of the year in MongoDB and indicate wether there is a booking for that date? That seems far from elegant.
Or should I compare the dates of the week with the dates retrieved from the server, so on the client side?
I think I am looking at this problem the wrong way. I would love to here somebody else's opinion on this. :)
Kind regards
I always start off with an ER model of what I have & what I want.
How I think you currently have it: 1 Room has many Reservations. 1 Reservation has 1 datetime.
How you want to access it: 1 Day has many Reservations. 1 Reservation has 1 datetime & 1 room.
The Mongo way to do it: 1 Reservation has 1 room & 1 date.
So your original idea was correct (I'm not sure what you mean by not being able to group in other collections, we can tackle that in comments if you like):
Reservations = {
name: 'The Johnson Family Reunion',
room: 'Grand Ballroom',
datetime: new Date
}
For simplicity, we'll assume you aren't changing months in this example & I assume you've already got the code down to assign days to those squares.
Each square in the calendar should follow a dayofMonth template.
That will afford you a this that has the date in your helper, so you can write something like this:
Template.dayOfMonth.helpers({
reservations: function() {
return Reservations.find({datetime.getDate():
this.datetime.getDate()}).sort(datetime);
}
}
Then, your template is something simple like:
{{#each reservations}}
{{reservations.name}}
{{/each}}
Hope it helps!

SSRS 2008 limiting scope based on expression

I have a fairly simple problem, but I don't think I understand SSRS and scopes well enough to figure this out.
What I have is a case (one entity) that can have multiple appointments (another entity). Appointments have a date and a status. I want to display the next soonest appointment date and its status. To display the date I'm using
=Min(IIf(Fields!appt_start.Value > Globals!ExecutionTime, Fields!appt_start.Value, Nothing))
The idea is that I first pick only those appointments that occur in the future, and then grab the soonest one. It seems to work great.
Now, I need to apply the same filtering logic, but display the appointment status rather than the date. From my understanding, this is where scopes would come in. I could limit my scope to just the appointment I want, and then show its status. But I don't understand how to do that.
One way to go about this particular problem would be to use a filter in combination with the First function. Add a filter to the table to only show dates greater than the current day. Use a table row with no grouping and use expressions like this:
=First(Fields!appt_start.Value)
=First(Fields!appt_status.Value)
Another option would be to add calculated fields to the dataset to only populate values such as status when the date is greater than the current day. This is useful if you need to show more information later on.
Edit: Yes, you would want to sort the data by date for the First function to work right. You can actually filter at 3 different levels in SSRS. Right-click on your dataset and go to Dataset Properties. Click on Filters. Click Add. Fill in the expression, operator, and value to meet your need. You can also do this in the group properties or the table properties.