Talend - How to loop over Date of Birth till the Current Year using tloop or tmap? - talend

I have a requirement where I am giving Date of Birth from tRowGenerator. I want to loop till the current year i.e. from date of birth to current year and display values in tlogrow.
I'm able to print Years, Months, seconds, M seconds difference using TalendDate diff function but not in a loop.
I tried figuring out a solution but could not succeed. Can anyone help me out?
Total result in 1 log:

Related

Mongodb query to retrieve data in month range

Does anyone know how to retrieve data by month using Mongodb query? For example, if I only want to retrieve the date range for the past month, or for the past two month, how do I do that? I see examples for getting data for the last N day (e.g for past 5 days using this new Date(new Date().setDate(new Date().getDate()-5) or N hours, but not seeing examples for only retrieving data for the last N month. Thanks,
Yes, You can retrieving data based on month like this.
new Date().setMonth(new Date().getMonth()-1) or N months.
And you can also get past month start and end date using moment like this.
moment().subtract(1,'months').startOf('month').format('YYYY-MM-DD')
it will provide previous month start date i.e 2021-01-01
moment().subtract(1,'months').endOf('month').format('YYYY-MM-DD');
it will provide previous month end date i.e 2021-01-31

Add default parameter regarding time SSRS

I am developing a report on task performance based on their working shift. Day shift will start on 9am to 9pm and night shift will start from 9pm to 9am. I would like to display data based on their current working shift as example, if someone is working on day shift and view report on 8pm, the report will show from range 9am to 8pm only and if user working for night shift, the report will only show from 9pm to 9am range
I have a dataset and parameter which is #begin_date and #end_date (eg. Monday, Tuesday...), #begin_hour and #end_hour. I got column "time" where the task complete.
Can someone help me?
EDIT:
Sorry, can you guide me, this is my propose sample code. Let say the current date is monday
If time <= 21 begin show 9am to (current time, limit 9pm monday) end Else if time >= 21 Begin Show 9pm to (current time, limit 9am tuesday)
End
How can i do this in sql?
Don't use a parameter at all. Add the logic into the stored proc or query that returns the results. Only show results from the beginning of the shift up to the current time.

Tableau: time series chart displaying last day of month instead of first

In any time series chart, it looks like Tableau defaults to the first day of the month on the tick marks.
Is there a way for Tableau to show the last day of the month instead?
You can sort of force it by going into "Edit Axis", starting it on a month end, and 1 as the monthly interval. However, this is not a dynamic process and would require that I update this every time I had new data.
Anyone have any ideas? Thank you!
If in your data series you want each data point to represent the whole month, and you just want to label it with the last date of that month, then this workaround might work:
use calculated field to coerce all dates in the month to the last date of that month: DATEADD('day',-1,DATEADD('month',1,DATETRUNC('month',[Order Date])))
use this field as date in your time series
use 'More -> Custom -> Month / Day /Year' as display option for this field

Creating Dynamic Date Column Headings in Cross Tab for Business Objects

BO Version: 12.1.0 on Infoview,
O/S: W7
I am creating a report in infoview, which is a cross-tab. I have departments on the row side and for the column I want to have all Saturday dates dynamically displayed, and this is dependent on the date prompt values I put in to the report when I run it.
So if I put in for the prompts Dec the 08th 2013 to Jan the 04th 2014 I should see 4 Saturday dates (14th/21st/28th/04th) along the column headers.
I started off using a variable and using the function relativedate, which gave me all the dates I wanted:
=RelativeDate(LastDayOfWeek([Query 1].[Episode End Date]);-1)
but because I used -1 to get the Saturday date it was giving me the Saturday before the earliest prompt date, so I was getting these dates instead:
(07th/14th/21st/28th/04th)
Is there a way I can get these dates but ignore the previous day (the 7th) before the start prompt date?
I want to have this dynamic so that if I put a date range in it shows me all the saturday dates within that range along the top of the report regardless of the date range period.
Andrew
The reason you're having trouble is that WebI (being ISO compliant) considers a week to run from Monday to Sunday, but your reporting week ends on Saturday.
So, I would approach it this way:
=RelativeDate(
LastDayOfWeek(
RelativeDate([Query 1].[Episode End Date];1)
)
;-1)
If we evaluate some dates with this logic, we'll see the desired result:
Testing 12/8 (Sunday):
Add one day = 12/9
Get Last Day Of Week = 12/15
Subtract one day = 12/14
Testing 12/12 (Thursday)
Add one day = 12/13
Get Last Day Of Week = 12/15
Subtract one day = 12/14
Testing 12/14 (Saturday)
Add one day = 12/15
Get Last Day Of Week = 12/15
Subtract one day = 12/14
I'm at home and don't have access to WebI right now, so I can't test this myself, but the logic should be sound.

Total Average Week using a Parameter

I have a crystal report that shows sales volumes called week to date volume. It shows current week, previous week, and average week. The report prompts for a date parameter and I extract the week number to get current week and previous week volumes. Did it this way because Mngmt wants to be able to run report whenever. My problem is for Average Week I cant figure out how to get the number of weeks to divide by for my average. Report originates from June 1st, 2010. Right now I have:
DATEPART("ww", {?date}) - DATEPART("ww", DATE(2010, 6, 1))
This returns 2 right now which is perfect, so i divide my total by 2. This code will work until the end of the year then I'm hooped. Any idea how I can make this a little more dynamic. I was thinking a counter somehow, just can't get the logic down because the date parameter will keep changing, meaning I cant increase my counter by 1 after each week???
Cheers.
Look into the Crystal Reports method: DateDiff.