current_date_Prognose_operativ_Service.iqd 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. COGNOS QUERY
  2. STRUCTURE,1,1
  3. DATABASE,Kalender
  4. DATASOURCENAME,C:\GAPS\Portal\System\IQD\Belege\current_date_Prognose_operativ_Service.imr
  5. TITLE,current_date_Prognose_operativ_Service.imr
  6. BEGIN SQL
  7. select c1 as c1,
  8. c2 as c2,
  9. c3 as c3,
  10. c4 as c4,
  11. c5 as c5,
  12. c6 as c6,
  13. c7 as c7,
  14. c8 as c8,
  15. c9 as c9,
  16. c10 as c10,
  17. c11 as c11,
  18. CASE WHEN (c4 = 1) THEN (RCOUNT(c4)) ELSE null END as c12,
  19. c13 as c13
  20. from
  21. (select T1."bundeslaender_id" as c1,
  22. T1."datum" as c2,
  23. T1."wochentage_id" as c3,
  24. T1."arbeitstag_mofr" as c4,
  25. T1."zaehler_mofr" as c5,
  26. T1."summe_mofr" as c6,
  27. T1."arbeitstag_mosa" as c7,
  28. T1."zaehler_mosa" as c8,
  29. T1."summe_mosa" as c9,
  30. T1."feiertage_id" as c10,
  31. (@CURRENT_DATE) - INTERVAL '001 00:00:00.000' as c11,
  32. CASE WHEN (T1."datum" BETWEEN TIMESTAMP '2008-01-01 00:00:00.000' AND TIMESTAMP '2008-12-31 00:00:00.000') THEN (252) WHEN (T1."datum" BETWEEN TIMESTAMP '2009-01-01 00:00:00.000' AND TIMESTAMP '2009-12-31 00:00:00.000') THEN (252) WHEN (T1."datum" BETWEEN TIMESTAMP '2010-01-01 00:00:00.000' AND TIMESTAMP '2010-12-31 00:00:00.000') THEN (253) WHEN (T1."datum" BETWEEN TIMESTAMP '2011-01-01 00:00:00.000' AND TIMESTAMP '2011-12-31 00:00:00.000') THEN (250) WHEN (T1."datum" BETWEEN TIMESTAMP '2012-01-01 00:00:00.000' AND TIMESTAMP '2012-12-31 00:00:00.000') THEN (249) ELSE (250) END as c13
  33. from "Arbeitstage" T1
  34. where (((T1."bundeslaender_id" = '4') and ((od_year(T1."datum")) = (extract(YEAR FROM ((@CURRENT_DATE) - INTERVAL '001 00:00:00.000'))))) and (T1."datum" <= ((@CURRENT_DATE) - INTERVAL '001 00:00:00.000')))
  35. order by c1 asc,c2 asc,c3 asc,c4 asc,c5 asc,c6 asc,c7 asc,c8 asc,c9 asc,c10 asc,c13 asc
  36. ) D1
  37. END SQL
  38. COLUMN,0,Bundeslaender Id
  39. COLUMN,1,Datum
  40. COLUMN,2,Wochentage Id
  41. COLUMN,3,Arbeitstag Mofr
  42. COLUMN,4,Zaehler Mofr
  43. COLUMN,5,Summe Mofr
  44. COLUMN,6,Arbeitstag Mosa
  45. COLUMN,7,Zaehler Mosa
  46. COLUMN,8,Summe Mosa
  47. COLUMN,9,Feiertage Id
  48. COLUMN,10,Jahr
  49. COLUMN,11,Arbeitstag Nr Jahr
  50. COLUMN,12,Gesamt Arbeitstage