Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

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

  1. #1
    Join Date
    Jul 2010
    Posts
    7

    Default 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. #2
    Join Date
    Oct 2007
    Posts
    107

    Default

    Hi Sandro,

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

    Cheers,
    C.
    Attached Files Attached Files

  3. #3

    Default

    Hi!
    Try use the String cut acticity during a transformation.
    Thanks!

  4. #4
    Join Date
    Jul 2010
    Posts
    7

    Default

    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. #5
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    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.
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

  6. #6
    Join Date
    Oct 2007
    Posts
    107

    Default

    Quote Originally Posted by Sandro1985 View Post
    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
    Attached Files Attached Files

  7. #7
    Join Date
    Jul 2010
    Posts
    7

    Default

    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. #8
    Join Date
    Oct 2007
    Posts
    107

    Default

    Quote Originally Posted by Sandro1985 View Post
    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
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.