top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Informatica - Get Date of Monday of a Week number

+3 votes
972 views

How to calculate the Monday date of a week using the week number in Informatica?!

posted Nov 27, 2014 by Amit Sharma

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

// We know week number and year.
int week = 42;
int year = 2014;

// Get calendar, clear it and set week number and year.
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(Calendar.WEEK_OF_YEAR, week);
calendar.set(Calendar.YEAR, year);

// Now get the first day of week.
Date date = calendar.getTime();

answer Dec 15, 2014 by Shweta Singh
Similar Questions
0 votes

I have the following table with the shown data in it:

send_date | household_ID

11-20-2014 | 123
11-20-2014 | 456
11-15-2014 | 789

I need to do 2 things:

1) Calculate the max value for send_date

2) Filter out any rows whose send_date does not match that value

In other words, I want the output to be:

send_date | household_ID

11-20-2014 | 123
11-20-2014 | 456

Row number 3 should be filtered out as its send_date is not the max.

I tried creating an aggregate, grouping by all columns, and creating a new output port called MAX_DATE with an expression of MAX(SEND_DATE), then have a filter transformation with the condition MAX_DATE = SEND_DATE

This lets all rows through, though. What can I do to make this work....

+2 votes

My question is very similar to the one below, but on a informatica environment:

Retrieving the index of an inserted row

Here is a brief summary of the issue: I'm trying to figure out how I can insert a row into a table and then find out what the value of the auto_incremented id column was set to so that I can insert additional data into another table. Our target is SQL server 2008. We have a table which has to be populated by informatica ETLs and the application is also using the same table - so, we can't use informatica sequence generator.

In the past when I have used Oracle database, there was a Oracle sequence generator transformation available in Informatica - but for SQL server, I am not sure.

Any solutions please?

+2 votes

I want to display the time stamp in following format '2011-04-22 10:41:57.000' to date as '04/22/2011' but when it convert it to following form TO_DATE(TO_CHAR(Date), 'MM/DD/YYYY HH24:MI:SS') it is displaying as null.

I am planning to use substring after the conversion

Can someone please tell me where i am going wrong?

+2 votes

I have two sessions I a workflow like below

workflow1->session1->session2

I have a join_date column in a table in Mapping1 , in session1. I want to pick this join_date value and pass to mpping2/session2

If join date value changes in the table in session1 then the same value should pick and pass to session2. I will use this date value in a query in session2 .

Please suggest how to achieve this?

0 votes

In informatica i receive dates from flat files in the format of dd-mm-yyyy and dd/mm/yyyy i need to convert all date to one format i.e dd-mm-yyyy using any expression and push into target ,so no rows gets rejected.how to proceed with them?

...