# Thread: No idea how to solve this problem in PDI!!!

1. Junior Member
Join Date
Jul 2010
Posts
7

## No idea how to solve this problem in PDI!!!

Hey Guys,

i have a big problem, hope you can help me to solve it.
I have a table with the name f_student which has a column Semester_KNZ. This column is from type BIGINT and stands for the semester range from 1973 till 2008 for all students. The problem is that the field values for this column are i.e.:

value | interpretation
20071 => year=2007 and 1= summersemester
20072 => year=2007 and 2 = wintersemester

I have build up a dimension table called d_semester which i want to fill with the range of semesters from 1973 till 2008. But i dont know how to split the field values i.e. 20071 into year = 2007 , type = summersemester and write it into the following table. The results should look like this:

d_semester
_________

Semester_TK_ID (auto-increment) | Semester_KNZ | SemesterYear | SemesterType
1 20071 2007 summersemester
2 20072 2007 wintersemester

Thank you in anticipation
Sandro

2. Senior Member
Join Date
Oct 2007
Posts
107
Hi Sandro,

Have a look at my example, it's quite easy to perform.

Cheers,
C.

3. Member
Join Date
Sep 2007
Posts
40
Hi!
Try use the String cut acticity during a transformation.
Thanks!

4. Junior Member
Join Date
Jul 2010
Posts
7
Hey CHamel,

thank you very much for your solution and it works great .

But i have an other question because i have a problem that i did not see beforehand !

The range of the semesters is not complete, there are missing parts and i want to have a dimension table that is complete from 1973 till 2009.

1 19731 1973 summersemester
2 19732 1973 wintersemester
....
n 20092 2009 wintersemester

It is possibly to write a Script which manually starts at 1973 and goes to 2009 with the special SemesterTypes (see above). I`am really new to PDI and i need the solution for my diploma.

thx
sandro
Last edited by Sandro1985; 07-29-2010 at 11:38 AM.

5. Senior Member
Join Date
Apr 2008
Posts
4,696
What if you go the other way?

Use two sets of Generate Rows, connected to Add Sequence, then Cartesian Join, and a Calculator?
Last edited by gutlez; 07-29-2010 at 12:07 PM.

6. Senior Member
Join Date
Oct 2007
Posts
107
Originally Posted by Sandro1985
Hey CHamel,

The range of the semesters is not complete, there are missing parts and i want to have a dimension table that is complete from 1973 till 2009.

1 19731 1973 summersemester
2 19732 1973 wintersemester
....
n 20092 2009 wintersemester

sandro
Something like that should do the trick.
Send me a copy of your diploma for my paper

7. Junior Member
Join Date
Jul 2010
Posts
7
Thanks CHamel it works perfectly !!! The diploma will be in german language that will be a big problem for you to unterstand, i think .

Have a nice day.

Sandro

8. Senior Member
Join Date
Oct 2007
Posts
107
Originally Posted by Sandro1985
Thanks CHamel it works perfectly !!! The diploma will be in german language that will be a big problem for you to unterstand, i think .

Have a nice day.

Sandro

Maybe not, I actually work for a German company :-)

Glad it did the trick, have fun.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•