F_Belege_SKR_SKR_Boettche_queries.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. CREATE VIEW [load].[current_date_Prognose]
  2. AS
  3. SELECT --[Bundeslaender Id] AS "Bundeslaender Id",
  4. [Invoice Date] AS "Bookkeep Date",
  5. --[Wochentage Id] AS "Wochentage Id",
  6. --[Arbeitstag Mofr] AS "Arbeitstag Mofr",
  7. [Zaehler Mofr] AS "Zaehler Mofr",
  8. [Summe Mofr] AS "Summe Mofr",
  9. --[Arbeitstag Mosa] AS "Arbeitstag Mosa",
  10. --[Zaehler Mosa] AS "Zaehler Mosa",
  11. --[Summe Mosa] AS "Summe Mosa",
  12. --[Feiertage Id] AS "Feiertage Id",
  13. --[Jahr] AS "Jahr",
  14. [Arbeitstag Nr Jahr] AS "Arbeitstag Nr Jahr",
  15. [Gesamt Arbeitstage] AS "Gesamt Arbeitstage",
  16. Monat_Belege AS "Monat_Belege"
  17. FROM [staging].[current_date_Prognose_fm]
  18. GO
  19. CREATE VIEW [load].[Kontenrahmen]
  20. AS
  21. SELECT --[Konto_Nr] AS "Konto_Nr",
  22. --[Konto_Bezeichnung] AS "Konto_Bezeichnung",
  23. --[Konto_Art] AS "Konto_Art",
  24. --[Kostenstelle] AS "Kostenstelle",
  25. --[STK] AS "STK",
  26. --[Konto_1] AS "Konto_1",
  27. --[Konto_2] AS "Konto_2",
  28. --[Konto_3] AS "Konto_3",
  29. --[Konto_4] AS "Konto_4",
  30. --[Konto_5] AS "Konto_5",
  31. --[Ebene1] AS "Ebene1",
  32. --[Ebene2] AS "Ebene2",
  33. --[Ebene3] AS "Ebene3",
  34. --[Ebene4] AS "Ebene4",
  35. --[Ebene5] AS "Ebene5",
  36. --[Ebene6] AS "Ebene6",
  37. --[Ebene7] AS "Ebene7",
  38. --[Ebene8] AS "Ebene8",
  39. --[Ebene9] AS "Ebene9",
  40. --[Ebene10] AS "Ebene10",
  41. [Ebene11] AS "Ebene11",
  42. --[Ebene12] AS "Ebene12",
  43. --[Ebene13] AS "Ebene13",
  44. --[Ebene14] AS "Ebene14",
  45. --[Ebene15] AS "Ebene15",
  46. --[Ebene16] AS "Ebene16",
  47. --[Ebene17] AS "Ebene17",
  48. --[Ebene18] AS "Ebene18",
  49. --[Ebene19] AS "Ebene19",
  50. --[Ebene20] AS "Ebene20",
  51. [Ebene21] AS "Ebene21",
  52. --[Ebene22] AS "Ebene22",
  53. --[Ebene23] AS "Ebene23",
  54. --[Ebene24] AS "Ebene24",
  55. --[Ebene25] AS "Ebene25",
  56. --[Ebene26] AS "Ebene26",
  57. --[Ebene27] AS "Ebene27",
  58. --[Ebene28] AS "Ebene28",
  59. --[Ebene29] AS "Ebene29",
  60. --[Ebene30] AS "Ebene30",
  61. [Ebene31] AS "Ebene31",
  62. --[Ebene32] AS "Ebene32",
  63. --[Ebene33] AS "Ebene33",
  64. --[Ebene34] AS "Ebene34",
  65. --[Ebene35] AS "Ebene35",
  66. --[Ebene36] AS "Ebene36",
  67. --[Ebene37] AS "Ebene37",
  68. --[Ebene38] AS "Ebene38",
  69. --[Ebene39] AS "Ebene39",
  70. --[Ebene40] AS "Ebene40",
  71. --[Ebene41] AS "Ebene41",
  72. --[Ebene42] AS "Ebene42",
  73. --[Ebene43] AS "Ebene43",
  74. --[Ebene44] AS "Ebene44",
  75. --[Ebene45] AS "Ebene45",
  76. --[Ebene46] AS "Ebene46",
  77. --[Ebene47] AS "Ebene47",
  78. --[Ebene48] AS "Ebene48",
  79. --[Ebene49] AS "Ebene49",
  80. --[Ebene50] AS "Ebene50",
  81. [Ebene51] AS "Ebene51",
  82. [Ebene52] AS "Ebene52",
  83. [Ebene53] AS "Ebene53",
  84. [Ebene54] AS "Ebene54",
  85. [Ebene55] AS "Ebene55",
  86. [Ebene56] AS "Ebene56",
  87. --[Ebene57] AS "Ebene57",
  88. --[Ebene58] AS "Ebene58",
  89. --[Ebene59] AS "Ebene59",
  90. --[Ebene60] AS "Ebene60",
  91. [Ebene61] AS "Ebene61",
  92. [Ebene62] AS "Ebene62",
  93. [Ebene63] AS "Ebene63",
  94. [Ebene64] AS "Ebene64",
  95. [Ebene65] AS "Ebene65",
  96. [Ebene66] AS "Ebene66",
  97. --[Ebene67] AS "Ebene67",
  98. --[Ebene68] AS "Ebene68",
  99. --[Ebene69] AS "Ebene69",
  100. --[Ebene70] AS "Ebene70"
  101. FROM [staging].[Kontenrahmen_fm]
  102. GO
  103. CREATE VIEW [load].[Kontenrahmen_GC_Struct_SKR]
  104. AS
  105. SELECT --[Konto Nr] AS "Konto Nr",
  106. --[Konto Bezeichnung] AS "Konto Bezeichnung",
  107. --[Konto Art_ori] AS "Konto Art_ori",
  108. --[Kostenstelle] AS "Kostenstelle",
  109. --[Stk] AS "Stk",
  110. --[Konto 1] AS "Konto 1",
  111. --[Konto 2] AS "Konto 2",
  112. --[Konto 3] AS "Konto 3",
  113. --[Konto 4] AS "Konto 4",
  114. --[Konto 5] AS "Konto 5",
  115. --[Ebene1] AS "Ebene1",
  116. --[Ebene2] AS "Ebene2",
  117. --[Ebene3] AS "Ebene3",
  118. --[Ebene4] AS "Ebene4",
  119. --[Ebene5] AS "Ebene5",
  120. --[Ebene6] AS "Ebene6",
  121. --[Ebene7] AS "Ebene7",
  122. --[Ebene8] AS "Ebene8",
  123. --[Ebene9] AS "Ebene9",
  124. --[Ebene10] AS "Ebene10",
  125. [Ebene11] AS "Ebene11",
  126. --[Ebene12] AS "Ebene12",
  127. --[Ebene13] AS "Ebene13",
  128. --[Ebene14] AS "Ebene14",
  129. --[Ebene15] AS "Ebene15",
  130. --[Ebene16] AS "Ebene16",
  131. --[Ebene17] AS "Ebene17",
  132. --[Ebene18] AS "Ebene18",
  133. --[Ebene19] AS "Ebene19",
  134. --[Ebene20] AS "Ebene20",
  135. [Ebene21] AS "Ebene21",
  136. --[Ebene22] AS "Ebene22",
  137. --[Ebene23] AS "Ebene23",
  138. --[Ebene24] AS "Ebene24",
  139. --[Ebene25] AS "Ebene25",
  140. --[Ebene26] AS "Ebene26",
  141. --[Ebene27] AS "Ebene27",
  142. --[Ebene28] AS "Ebene28",
  143. --[Ebene29] AS "Ebene29",
  144. --[Ebene30] AS "Ebene30",
  145. [Ebene31] AS "Ebene31",
  146. --[Ebene32] AS "Ebene32",
  147. --[Ebene33] AS "Ebene33",
  148. --[Ebene34] AS "Ebene34",
  149. --[Ebene35] AS "Ebene35",
  150. --[Ebene36] AS "Ebene36",
  151. --[Ebene37] AS "Ebene37",
  152. --[Ebene38] AS "Ebene38",
  153. --[Ebene39] AS "Ebene39",
  154. --[Ebene40] AS "Ebene40",
  155. --[Ebene41] AS "Ebene41",
  156. --[Ebene42] AS "Ebene42",
  157. --[Ebene43] AS "Ebene43",
  158. --[Ebene44] AS "Ebene44",
  159. --[Ebene45] AS "Ebene45",
  160. --[Ebene46] AS "Ebene46",
  161. --[Ebene47] AS "Ebene47",
  162. --[Ebene48] AS "Ebene48",
  163. --[Ebene49] AS "Ebene49",
  164. --[Ebene50] AS "Ebene50",
  165. [Ebene51] AS "Ebene51",
  166. [Ebene52] AS "Ebene52",
  167. [Ebene53] AS "Ebene53",
  168. [Ebene54] AS "Ebene54",
  169. [Ebene55] AS "Ebene55",
  170. [Ebene56] AS "Ebene56",
  171. --[Ebene57] AS "Ebene57",
  172. --[Ebene58] AS "Ebene58",
  173. --[Ebene59] AS "Ebene59",
  174. --[Ebene60] AS "Ebene60",
  175. [Ebene61] AS "Ebene61",
  176. [Ebene62] AS "Ebene62",
  177. [Ebene63] AS "Ebene63",
  178. [Ebene64] AS "Ebene64",
  179. [Ebene65] AS "Ebene65",
  180. [Ebene66] AS "Ebene66",
  181. --[Ebene67] AS "Ebene67",
  182. --[Ebene68] AS "Ebene68",
  183. --[Ebene69] AS "Ebene69",
  184. --[Ebene70] AS "Ebene70",
  185. [Ebene71] AS "Ebene71",
  186. [Ebene72] AS "Ebene72",
  187. [Ebene73] AS "Ebene73",
  188. [Ebene74] AS "Ebene74",
  189. [Ebene75] AS "Ebene75",
  190. [Ebene76] AS "Ebene76",
  191. [Ebene77] AS "Ebene77",
  192. --[Ebene78] AS "Ebene78",
  193. --[Ebene79] AS "Ebene79",
  194. --[Ebene80] AS "Ebene80",
  195. --[Anzahl Stellen_Konto_Nr] AS "Anzahl Stellen_Konto_Nr",
  196. --[Konto Art] AS "Konto Art",
  197. [GuV_Bilanz] AS "GuV_Bilanz",
  198. [Acct Nr] AS "Acct Nr",
  199. [Konto] AS "Konto",
  200. [Susa] AS "Susa"
  201. FROM [staging].[Kontenrahmen_GC_Struct_SKR_fm]
  202. GO
  203. CREATE VIEW [load].[Kontenrahmen_KST_90]
  204. AS
  205. SELECT --[Konto_Nr] AS "Konto_Nr",
  206. --[_90] AS "_90",
  207. [Acct Nr] AS "Acct Nr",
  208. --[Konto_Bezeichnung] AS "Konto_Bezeichnung",
  209. --[Konto_Art] AS "Konto_Art",
  210. --[Kostenstelle] AS "Kostenstelle",
  211. --[STK] AS "STK",
  212. --[Konto_1] AS "Konto_1",
  213. --[Konto_2] AS "Konto_2",
  214. --[Konto_3] AS "Konto_3",
  215. --[Konto_4] AS "Konto_4",
  216. --[Konto_5] AS "Konto_5",
  217. --[Ebene1] AS "Ebene1",
  218. --[Ebene2] AS "Ebene2",
  219. --[Ebene3] AS "Ebene3",
  220. --[Ebene4] AS "Ebene4",
  221. --[Ebene5] AS "Ebene5",
  222. --[Ebene6] AS "Ebene6",
  223. --[Ebene7] AS "Ebene7",
  224. --[Ebene8] AS "Ebene8",
  225. --[Ebene9] AS "Ebene9",
  226. --[Ebene10] AS "Ebene10",
  227. [Ebene11] AS "Ebene11",
  228. --[Ebene12] AS "Ebene12",
  229. --[Ebene13] AS "Ebene13",
  230. --[Ebene14] AS "Ebene14",
  231. --[Ebene15] AS "Ebene15",
  232. --[Ebene16] AS "Ebene16",
  233. --[Ebene17] AS "Ebene17",
  234. --[Ebene18] AS "Ebene18",
  235. --[Ebene19] AS "Ebene19",
  236. --[Ebene20] AS "Ebene20",
  237. [Ebene21] AS "Ebene21",
  238. --[Ebene22] AS "Ebene22",
  239. --[Ebene23] AS "Ebene23",
  240. --[Ebene24] AS "Ebene24",
  241. --[Ebene25] AS "Ebene25",
  242. --[Ebene26] AS "Ebene26",
  243. --[Ebene27] AS "Ebene27",
  244. --[Ebene28] AS "Ebene28",
  245. --[Ebene29] AS "Ebene29",
  246. --[Ebene30] AS "Ebene30",
  247. [Ebene31] AS "Ebene31",
  248. --[Ebene32] AS "Ebene32",
  249. --[Ebene33] AS "Ebene33",
  250. --[Ebene34] AS "Ebene34",
  251. --[Ebene35] AS "Ebene35",
  252. --[Ebene36] AS "Ebene36",
  253. --[Ebene37] AS "Ebene37",
  254. --[Ebene38] AS "Ebene38",
  255. --[Ebene39] AS "Ebene39",
  256. --[Ebene40] AS "Ebene40",
  257. --[Ebene41] AS "Ebene41",
  258. --[Ebene42] AS "Ebene42",
  259. --[Ebene43] AS "Ebene43",
  260. --[Ebene44] AS "Ebene44",
  261. --[Ebene45] AS "Ebene45",
  262. --[Ebene46] AS "Ebene46",
  263. --[Ebene47] AS "Ebene47",
  264. --[Ebene48] AS "Ebene48",
  265. --[Ebene49] AS "Ebene49",
  266. --[Ebene50] AS "Ebene50",
  267. [Ebene51] AS "Ebene51",
  268. [Ebene52] AS "Ebene52",
  269. [Ebene53] AS "Ebene53",
  270. [Ebene54] AS "Ebene54",
  271. [Ebene55] AS "Ebene55",
  272. [Ebene56] AS "Ebene56",
  273. --[Ebene57] AS "Ebene57",
  274. --[Ebene58] AS "Ebene58",
  275. --[Ebene59] AS "Ebene59",
  276. --[Ebene60] AS "Ebene60",
  277. [Ebene61] AS "Ebene61",
  278. [Ebene62] AS "Ebene62",
  279. [Ebene63] AS "Ebene63",
  280. [Ebene64] AS "Ebene64",
  281. [Ebene65] AS "Ebene65",
  282. [Ebene66] AS "Ebene66",
  283. --[Ebene67] AS "Ebene67",
  284. --[Ebene68] AS "Ebene68",
  285. --[Ebene69] AS "Ebene69",
  286. --[Ebene70] AS "Ebene70",
  287. [Ebene71] AS "Ebene71",
  288. [Ebene72] AS "Ebene72",
  289. [Ebene73] AS "Ebene73",
  290. [Ebene74] AS "Ebene74",
  291. [Ebene75] AS "Ebene75",
  292. [Ebene76] AS "Ebene76",
  293. [Ebene77] AS "Ebene77",
  294. --[Ebene78] AS "Ebene78",
  295. --[Ebene79] AS "Ebene79",
  296. --[Ebene80] AS "Ebene80"
  297. FROM [staging].[Kontenrahmen_KST_90_fm]
  298. GO
  299. CREATE VIEW [load].[Kontenrahmen_STK]
  300. AS
  301. SELECT --[Konto_Nr] AS "Konto_Nr",
  302. --[Konto_Bezeichnung] AS "Konto_Bezeichnung",
  303. --[Konto_Art] AS "Konto_Art",
  304. --[Kostenstelle] AS "Kostenstelle",
  305. --[STK] AS "STK",
  306. --[Konto_1] AS "Konto_1",
  307. --[Konto_2] AS "Konto_2",
  308. --[Konto_3] AS "Konto_3",
  309. --[Konto_4] AS "Konto_4",
  310. --[Konto_5] AS "Konto_5",
  311. --[Ebene1] AS "Ebene1",
  312. --[Ebene2] AS "Ebene2",
  313. --[Ebene3] AS "Ebene3",
  314. --[Ebene4] AS "Ebene4",
  315. --[Ebene5] AS "Ebene5",
  316. --[Ebene6] AS "Ebene6",
  317. --[Ebene7] AS "Ebene7",
  318. --[Ebene8] AS "Ebene8",
  319. --[Ebene9] AS "Ebene9",
  320. --[Ebene10] AS "Ebene10",
  321. [Ebene11] AS "Ebene11",
  322. --[Ebene12] AS "Ebene12",
  323. --[Ebene13] AS "Ebene13",
  324. --[Ebene14] AS "Ebene14",
  325. --[Ebene15] AS "Ebene15",
  326. --[Ebene16] AS "Ebene16",
  327. --[Ebene17] AS "Ebene17",
  328. --[Ebene18] AS "Ebene18",
  329. --[Ebene19] AS "Ebene19",
  330. --[Ebene20] AS "Ebene20",
  331. [Ebene21] AS "Ebene21",
  332. --[Ebene22] AS "Ebene22",
  333. --[Ebene23] AS "Ebene23",
  334. --[Ebene24] AS "Ebene24",
  335. --[Ebene25] AS "Ebene25",
  336. --[Ebene26] AS "Ebene26",
  337. --[Ebene27] AS "Ebene27",
  338. --[Ebene28] AS "Ebene28",
  339. --[Ebene29] AS "Ebene29",
  340. --[Ebene30] AS "Ebene30",
  341. [Ebene31] AS "Ebene31",
  342. --[Ebene32] AS "Ebene32",
  343. --[Ebene33] AS "Ebene33",
  344. --[Ebene34] AS "Ebene34",
  345. --[Ebene35] AS "Ebene35",
  346. --[Ebene36] AS "Ebene36",
  347. --[Ebene37] AS "Ebene37",
  348. --[Ebene38] AS "Ebene38",
  349. --[Ebene39] AS "Ebene39",
  350. --[Ebene40] AS "Ebene40",
  351. --[Ebene41] AS "Ebene41",
  352. --[Ebene42] AS "Ebene42",
  353. --[Ebene43] AS "Ebene43",
  354. --[Ebene44] AS "Ebene44",
  355. --[Ebene45] AS "Ebene45",
  356. --[Ebene46] AS "Ebene46",
  357. --[Ebene47] AS "Ebene47",
  358. --[Ebene48] AS "Ebene48",
  359. --[Ebene49] AS "Ebene49",
  360. --[Ebene50] AS "Ebene50",
  361. [Ebene51] AS "Ebene51",
  362. [Ebene52] AS "Ebene52",
  363. [Ebene53] AS "Ebene53",
  364. [Ebene54] AS "Ebene54",
  365. [Ebene55] AS "Ebene55",
  366. [Ebene56] AS "Ebene56",
  367. --[Ebene57] AS "Ebene57",
  368. --[Ebene58] AS "Ebene58",
  369. --[Ebene59] AS "Ebene59",
  370. --[Ebene60] AS "Ebene60",
  371. [Ebene61] AS "Ebene61",
  372. [Ebene62] AS "Ebene62",
  373. [Ebene63] AS "Ebene63",
  374. [Ebene64] AS "Ebene64",
  375. [Ebene65] AS "Ebene65",
  376. [Ebene66] AS "Ebene66",
  377. --[Ebene67] AS "Ebene67",
  378. --[Ebene68] AS "Ebene68",
  379. --[Ebene69] AS "Ebene69",
  380. --[Ebene70] AS "Ebene70"
  381. FROM [staging].[Kontenrahmen_STK_fm]
  382. GO
  383. CREATE VIEW [load].[SKR_Absatzkanal]
  384. AS
  385. SELECT [Ebene21] AS "Ebene21",
  386. [Absatzkanal_mit_Bez] AS "Absatzkanal_mit_Bez",
  387. --[Ebene23] AS "Ebene23",
  388. --[Ebene24] AS "Ebene24",
  389. --[Ebene25] AS "Ebene25",
  390. --[Ebene26] AS "Ebene26",
  391. --[Ebene27] AS "Ebene27",
  392. --[Ebene28] AS "Ebene28",
  393. --[Ebene29] AS "Ebene29",
  394. --[Ebene30] AS "Ebene30",
  395. [Absatzkanal] AS "Absatzkanal"
  396. FROM [staging].[SKR_Absatzkanal_fm]
  397. GO
  398. CREATE VIEW [load].[SKR_Herkunft_KST]
  399. AS
  400. SELECT [Ebene11] AS "Ebene11",
  401. [KST_mit_Bez] AS "KST_mit_Bez",
  402. --[Ebene13] AS "Ebene13",
  403. --[Ebene14] AS "Ebene14",
  404. --[Ebene15] AS "Ebene15",
  405. --[Ebene16] AS "Ebene16",
  406. --[Ebene17] AS "Ebene17",
  407. --[Ebene18] AS "Ebene18",
  408. --[Ebene19] AS "Ebene19",
  409. --[Ebene20] AS "Ebene20",
  410. [KST] AS "KST"
  411. FROM [staging].[SKR_Herkunft_KST_fm]
  412. GO
  413. CREATE VIEW [load].[SKR_Kostenträger]
  414. AS
  415. SELECT [Ebene31] AS "Ebene31",
  416. --[Ebene32] AS "Ebene32",
  417. --[Ebene33] AS "Ebene33",
  418. --[Ebene34] AS "Ebene34",
  419. --[Ebene35] AS "Ebene35",
  420. --[Ebene36] AS "Ebene36",
  421. --[Ebene37] AS "Ebene37",
  422. --[Ebene38] AS "Ebene38",
  423. --[Ebene39] AS "Ebene39",
  424. --[Ebene40] AS "Ebene40",
  425. [Kostenträger_mit_Bez] AS "Kostenträger_mit_Bez",
  426. --[Ebene_Marke] AS "Ebene_Marke",
  427. [Kostenträger_FIBU] AS "Kostenträger_FIBU"
  428. FROM [staging].[SKR_Kostenträger_fm]
  429. GO
  430. CREATE VIEW [load].[SKR_Marke]
  431. AS
  432. SELECT [Marke_mit_Bez] AS "Marke_mit_Bez",
  433. --[Ebene42] AS "Ebene42",
  434. --[Ebene43] AS "Ebene43",
  435. --[Ebene44] AS "Ebene44",
  436. --[Ebene45] AS "Ebene45",
  437. --[Ebene46] AS "Ebene46",
  438. --[Ebene47] AS "Ebene47",
  439. --[Ebene48] AS "Ebene48",
  440. --[Ebene49] AS "Ebene49",
  441. --[Ebene50] AS "Ebene50",
  442. [Marke] AS "Marke"
  443. FROM [staging].[SKR_Marke_fm]
  444. GO
  445. CREATE VIEW [load].[Belege_EDS_SKR_ohne_KST_90]
  446. AS
  447. SELECT [Rechtseinheit_ID] AS "Rechtseinheit_ID",
  448. [Rechtseinheit_Name] AS "Rechtseinheit_Name",
  449. [Betrieb_ID] AS "Betrieb_ID",
  450. [Betrieb_Name] AS "Betrieb_Name",
  451. [Konto] AS "Konto",
  452. [Acct Nr] AS "Acct Nr",
  453. [Text] AS "Text",
  454. --[Kostenstelle_ori] AS "Kostenstelle_ori",
  455. --[KST_mit_Bez_ori] AS "KST_mit_Bez_ori",
  456. [KST] AS "KST",
  457. [Markencode] AS "Markencode",
  458. [Fahrgestellnummer] AS "Fahrgestellnummer",
  459. [Konto_Buchung] AS "Konto_Buchung",
  460. --[Marke_mit_Bez_ori] AS "Marke_mit_Bez_ori",
  461. [Marke] AS "Marke",
  462. --[Ebene21_ori] AS "Ebene21_ori",
  463. --[Absatzkanal_mit_Bez_ori] AS "Absatzkanal_mit_Bez_ori",
  464. [Absatzkanal] AS "Absatzkanal",
  465. --[Ebene31_ori] AS "Ebene31_ori",
  466. --[Kostenträger_mit_Bez_ori] AS "Kostenträger_mit_Bez_ori",
  467. [Kostenträger_FIBU] AS "Kostenträger_FIBU",
  468. [Ebene71] AS "Ebene71",
  469. [Ebene72] AS "Ebene72",
  470. [Ebene73] AS "Ebene73",
  471. [Ebene74] AS "Ebene74",
  472. [Ebene75] AS "Ebene75",
  473. [Ebene76] AS "Ebene76",
  474. [Ebene77] AS "Ebene77",
  475. --[Ebene81] AS "Ebene81",
  476. --[Ebene82] AS "Ebene82",
  477. --[Ebene83] AS "Ebene83",
  478. --[Ebene84] AS "Ebene84",
  479. --[Ebene85] AS "Ebene85",
  480. --[Ebene86] AS "Ebene86",
  481. [GuV_Bilanz] AS "GuV_Bilanz",
  482. [Susa] AS "Susa",
  483. [Mandant] AS "Mandant",
  484. [Ist] AS "Ist",
  485. [Menge] AS "Menge",
  486. --[Fabrikat] AS "Fabrikat",
  487. --[Fabrikat_Order_By] AS "Fabrikat_Order_By",
  488. [Bookkeep Date] AS "Bookkeep Date",
  489. [Ebene61] AS "Ebene61",
  490. [Ebene62] AS "Ebene62",
  491. [Ebene63] AS "Ebene63",
  492. [Ebene64] AS "Ebene64",
  493. [Ebene65] AS "Ebene65",
  494. [Ebene66] AS "Ebene66",
  495. Monat_Belege AS "Monat_Belege"
  496. FROM [staging].[Belege_EDS_SKR_ohne_KST_90_fm]
  497. GO
  498. CREATE VIEW [load].[Belege_EDS_SKR_KST_90]
  499. AS
  500. SELECT [Rechtseinheit_ID] AS "Rechtseinheit_ID",
  501. [Rechtseinheit_Name] AS "Rechtseinheit_Name",
  502. [Betrieb_ID] AS "Betrieb_ID",
  503. [Betrieb_Name] AS "Betrieb_Name",
  504. [Konto] AS "Konto",
  505. [Acct Nr] AS "Acct Nr",
  506. [Text] AS "Text",
  507. --[Kostenstelle_ori] AS "Kostenstelle_ori",
  508. --[KST_mit_Bez_ori] AS "KST_mit_Bez_ori",
  509. [KST] AS "KST",
  510. [Markencode] AS "Markencode",
  511. [Fahrgestellnummer] AS "Fahrgestellnummer",
  512. [Konto_Buchung] AS "Konto_Buchung",
  513. --[Marke_mit_Bez_ori] AS "Marke_mit_Bez_ori",
  514. [Marke] AS "Marke",
  515. --[Ebene21_ori] AS "Ebene21_ori",
  516. --[Absatzkanal_mit_Bez_ori] AS "Absatzkanal_mit_Bez_ori",
  517. [Absatzkanal] AS "Absatzkanal",
  518. --[Ebene31_ori] AS "Ebene31_ori",
  519. --[Kostenträger_mit_Bez_ori] AS "Kostenträger_mit_Bez_ori",
  520. [Kostenträger_FIBU] AS "Kostenträger_FIBU",
  521. [Ebene71] AS "Ebene71",
  522. [Ebene72] AS "Ebene72",
  523. [Ebene73] AS "Ebene73",
  524. [Ebene74] AS "Ebene74",
  525. [Ebene75] AS "Ebene75",
  526. [Ebene76] AS "Ebene76",
  527. [Ebene77] AS "Ebene77",
  528. --[Ebene81] AS "Ebene81",
  529. --[Ebene82] AS "Ebene82",
  530. --[Ebene83] AS "Ebene83",
  531. --[Ebene84] AS "Ebene84",
  532. --[Ebene85] AS "Ebene85",
  533. --[Ebene86] AS "Ebene86",
  534. [GuV_Bilanz] AS "GuV_Bilanz",
  535. [Susa] AS "Susa",
  536. [Mandant] AS "Mandant",
  537. [Ist] AS "Ist",
  538. [Menge] AS "Menge",
  539. --[Fabrikat] AS "Fabrikat",
  540. --[Fabrikat_Order_By] AS "Fabrikat_Order_By",
  541. [Bookkeep Date] AS "Bookkeep Date",
  542. [Ebene61] AS "Ebene61",
  543. [Ebene62] AS "Ebene62",
  544. [Ebene63] AS "Ebene63",
  545. [Ebene64] AS "Ebene64",
  546. [Ebene65] AS "Ebene65",
  547. [Ebene66] AS "Ebene66",
  548. Monat_Belege AS "Monat_Belege"
  549. FROM [staging].[Belege_EDS_SKR_KST_90_fm]
  550. GO
  551. CREATE VIEW [load].[Belege_EDS_SKR_Stk]
  552. AS
  553. SELECT [Rechtseinheit_ID] AS "Rechtseinheit_ID",
  554. [Rechtseinheit_Name] AS "Rechtseinheit_Name",
  555. [Betrieb_ID] AS "Betrieb_ID",
  556. [Betrieb_Name] AS "Betrieb_Name",
  557. [Konto] AS "Konto",
  558. [Acct Nr] AS "Acct Nr",
  559. [Text] AS "Text",
  560. --[Kostenstelle_ori] AS "Kostenstelle_ori",
  561. --[KST_mit_Bez_ori] AS "KST_mit_Bez_ori",
  562. [KST] AS "KST",
  563. [Markencode] AS "Markencode",
  564. [Fahrgestellnummer] AS "Fahrgestellnummer",
  565. [Konto_Buchung] AS "Konto_Buchung",
  566. --[Marke_mit_Bez_ori] AS "Marke_mit_Bez_ori",
  567. [Marke] AS "Marke",
  568. --[Ebene21_ori] AS "Ebene21_ori",
  569. --[Absatzkanal_mit_Bez_ori] AS "Absatzkanal_mit_Bez_ori",
  570. [Absatzkanal] AS "Absatzkanal",
  571. --[Ebene31_ori] AS "Ebene31_ori",
  572. --[Kostenträger_mit_Bez_ori] AS "Kostenträger_mit_Bez_ori",
  573. [Kostenträger_FIBU] AS "Kostenträger_FIBU",
  574. [Ebene71] AS "Ebene71",
  575. [Ebene72] AS "Ebene72",
  576. [Ebene73] AS "Ebene73",
  577. [Ebene74] AS "Ebene74",
  578. [Ebene75] AS "Ebene75",
  579. [Ebene76] AS "Ebene76",
  580. [Ebene77] AS "Ebene77",
  581. --[Ebene81] AS "Ebene81",
  582. --[Ebene82] AS "Ebene82",
  583. --[Ebene83] AS "Ebene83",
  584. --[Ebene84] AS "Ebene84",
  585. --[Ebene85] AS "Ebene85",
  586. --[Ebene86] AS "Ebene86",
  587. [GuV_Bilanz] AS "GuV_Bilanz",
  588. [Susa] AS "Susa",
  589. [Mandant] AS "Mandant",
  590. [Ist] AS "Ist_Stk",
  591. [Menge] AS "Menge",
  592. --[Fabrikat] AS "Fabrikat",
  593. --[Fabrikat_Order_By] AS "Fabrikat_Order_By",
  594. [Bookkeep Date] AS "Bookkeep Date",
  595. [Ebene61] AS "Ebene61",
  596. [Ebene62] AS "Ebene62",
  597. [Ebene63] AS "Ebene63",
  598. [Ebene64] AS "Ebene64",
  599. [Ebene65] AS "Ebene65",
  600. [Ebene66] AS "Ebene66",
  601. Monat_Belege AS "Monat_Belege"
  602. FROM [staging].[Belege_EDS_SKR_Stk_fm]
  603. GO