3 Replies Latest reply: Jul 20, 2010 12:51 PM by Muzammil Syed RSS

    Need help with a data model

      I am trying to build a QlikView model to represent our staffing history & projection. I am having a problem representing the case where one table is related to another table in two different ways.

      For example:

      I have Consultants and I have Projects as tables in my QV data model.

      A Consultant is assigned to a Project, and also has a Project that they will be working on after their current Project (or maybe they don't, indicating we need to find a next Project for them). How would I build this relationship between the Consultant and the Projects? Both the current Project and next Project come from the same list of Projects.

      Any help is appreciated.

      Thanks,
      -Simon-

        • Need help with a data model
          Muzammil Syed

          Hi Simon,

          You can have two fields as CURRENT_PROJECT and NEXT_PROJECT in your CONSULTANT table. They will be pointing to the PROJECT in the PROJECT table.

            • Need help with a data model

              That sounds like it would work!

              How would I do that though, since the field names would be different? I thought QlikView linked on field name. Am I missing something?

                • Need help with a data model
                  Muzammil Syed

                  Hi Simon,

                  Sorry it was i who missed the trick. But here is another way.

                  Make a table Consultant_1 with Cuurent project(Field name as PROJECT_ID) as one field also make another field as Project_Type in dat u can specify only a text as "Current" .

                  Make another table Consultant_2 with Next_project (Field name as PROJECT_ID) as one field also make another field as Project_Type in dat u can specify only a text as "Next" .

                  Now join these two tables . You can differentiate the current and next project depending on the Project_Type feild.