Sollstunden_MA_deop03_Berufsgruppe.iqd 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,O21_3
  4. DATASOURCENAME,C:\GAPS\Portal\System\IQD\Zeiten\Sollstunden_MA_deop03_Berufsgruppe.imr
  5. TITLE,Sollstunden_MA_deop03_Berufsgruppe.imr
  6. BEGIN SQL
  7. select T1."CALENDAR_INFO_ID" as c1,
  8. T1."CALENDAR_TYPE_ID" as c2,
  9. T1."RECURRING_PATTERN_ID" as c3,
  10. T1."RECURRING_PATTERN_PRIORITY" as c4,
  11. T1."TRANSACT_DATE" as c5,
  12. T2."SEL_NAME" as c6,
  13. (od_right(T1."RECURRING_PATTERN_ID",3)) as c7,
  14. T3."CORE_WORKING_HOURS" as c8,
  15. T4."WORK_LEADER_GROUP" as c9,
  16. T4."WORKLEADER_TEXT" as c10,
  17. T4."WORK_LEADER_GROUP" || ' - ' || T4."WORKLEADER_TEXT" as c11,
  18. (rtrim(((rtrim(T5."PROFILE_CODE")) || '_' || (database())))) || ' - ' || T2."SEL_NAME" as c12,
  19. T6."PERS_DEPARTMENT" as c13,
  20. '1' as c14,
  21. (od_left(T2."SEL_DEPARTMENT",2)) as c15,
  22. T5."PROFILE_CODE" as c16,
  23. CASE WHEN ((substring(T2."SEL_DEPARTMENT" from 3 for 2)) = '20') THEN ('2') WHEN ((substring(T2."SEL_DEPARTMENT" from 3 for 2)) IN ('30','80')) THEN ('6') WHEN ((substring(T2."SEL_DEPARTMENT" from 3 for 2)) = '40') THEN ('3') WHEN ((substring(T2."SEL_DEPARTMENT" from 3 for 2)) = '41') THEN ('4') WHEN (T2."SEL_DEPARTMENT" IN ('1F ')) THEN ('3') ELSE null END as c17,
  24. '' as c18,
  25. T7."WORK_LEADER_GROUP_ID" as c19,
  26. T7."JOB_END_DATE" as c20,
  27. T3."RECURRING_PATTERN_ID" as c21,
  28. T3."CORE_WORKING_HOURS" as c22,
  29. T3."WORKINGDAY" as c23,
  30. T3."START_DAY_ID" as c24,
  31. T8."bundeslaender_id" as c25,
  32. T8."datum" as c26,
  33. T8."wochentage_id" as c27,
  34. T8."arbeitstag_mofr" as c28,
  35. T8."zaehler_mofr" as c29,
  36. T8."summe_mofr" as c30,
  37. T8."arbeitstag_mosa" as c31,
  38. T8."zaehler_mosa" as c32,
  39. T8."summe_mosa" as c33,
  40. T8."feiertage_id" as c34,
  41. T8."Jahr" as c35,
  42. T8."Arbeitstag Nr Jahr" as c36,
  43. T8."Gesamt Arbeitstage" as c37,
  44. (nconvert(T8."wochentage_id")) as c38,
  45. T3."CORE_WORKING_HOURS" as c39,
  46. (@CURRENT_DATE) - INTERVAL '001 00:00:00.000' as c40,
  47. (database()) as c41,
  48. T7."PROFESSION_GROUP_ID" as c42,
  49. (rtrim(T5."PROFILE_CODE")) || '_' || (database()) as c43
  50. from "deop03"."dbo"."WORKING_PERIOD" T3,
  51. "deop03"."dbo"."EMPLOYEE" T7,
  52. "deop03"."dbo"."vPP91" T4,
  53. QSS."C:\GAPS\Portal\System\IQD\Zeiten\Kalender.ims" T8,
  54. (("deop03"."dbo"."CALENDAR_INFO" T9 left outer join "deop03"."dbo"."CALENDAR_PATTERN" T1 on T1."CALENDAR_INFO_ID" = T9."REFERENCE_IDENT") left outer join "deop03"."dbo"."PERSON_INFO" T6 on T9."REFERENCE_NAME" = T6."PERSON_NUMBER"),
  55. ("deop03"."dbo"."vPP43" T2 left outer join "deop03"."dbo"."PROFILE" T5 on T2."SELLER_CODE" = T5."PROFILE_CODE")
  56. where (T5."PROFILE_CODE" = T9."REFERENCE_NAME") and (T1."RECURRING_PATTERN_ID" = T3."RECURRING_PATTERN_ID") and (T7."PERSON_ID" = T5."PERSON_ID") and (T4."WORK_LEADER_GROUP" = T7."WORK_LEADER_GROUP_ID")
  57. and ((((((((T3."WORKINGDAY" = 1) and (T7."PROFESSION_GROUP_ID" IN (10,11,20,30))) and (T7."JOB_END_DATE" = TIMESTAMP '1800-01-01 00:00:00.000')) and ((T1."RECURRING_PATTERN_PRIORITY" = 0) or (T1."RECURRING_PATTERN_PRIORITY" IS NULL))) and (T8."wochentage_id" IN ('4','5','1','2','3'))) and (T3."START_DAY_ID" = ((nconvert(T8."wochentage_id"))) + 1)) and (T8."datum" <= ((@CURRENT_DATE) - INTERVAL '001 00:00:00.000'))) and (T8."datum" >= TIMESTAMP '2016-07-27 00:00:00.000'))
  58. order by c6 asc
  59. END SQL
  60. COLUMN,0,Calendar Info Id
  61. COLUMN,1,Calendar Type Id
  62. COLUMN,2,Recurring Pattern Id
  63. COLUMN,3,Recurring Pattern Priority
  64. COLUMN,4,Transact Date
  65. COLUMN,5,Name
  66. COLUMN,6,Pattern_rechts_3
  67. COLUMN,7,Std_Tag
  68. COLUMN,8,Work Leader Group
  69. COLUMN,9,Workleader Text
  70. COLUMN,10,Monteur_Gruppe
  71. COLUMN,11,Monteur
  72. COLUMN,12,Pers Department
  73. COLUMN,13,Hauptbetrieb
  74. COLUMN,14,Standort
  75. COLUMN,15,Profile Code
  76. COLUMN,16,Kostenstelle
  77. COLUMN,17,Order Number
  78. COLUMN,18,Work Leader Group Id
  79. COLUMN,19,Job End Date
  80. COLUMN,20,Recurring Pattern Id_aus_Workin_Period
  81. COLUMN,21,Core Working Hours
  82. COLUMN,22,Workingday
  83. COLUMN,23,Start Day Id
  84. COLUMN,24,Bundeslaender Id
  85. COLUMN,25,Datum
  86. COLUMN,26,Wochentage Id
  87. COLUMN,27,Arbeitstag Mofr
  88. COLUMN,28,Zaehler Mofr
  89. COLUMN,29,Summe Mofr
  90. COLUMN,30,Arbeitstag Mosa
  91. COLUMN,31,Zaehler Mosa
  92. COLUMN,32,Summe Mosa
  93. COLUMN,33,Feiertage Id
  94. COLUMN,34,Jahr_alt
  95. COLUMN,35,Arbeitstag Nr Jahr
  96. COLUMN,36,Gesamt Arbeitstage
  97. COLUMN,37,Wochentag_Kalender_Zahl
  98. COLUMN,38,Soll-Std.
  99. COLUMN,39,Jahr
  100. COLUMN,40,Mandant
  101. COLUMN,41,Profession Group Id
  102. COLUMN,42,Profile Code DB