2 changed files with 1112 additions and 0 deletions
@ -0,0 +1,662 @@
@@ -0,0 +1,662 @@
|
||||
--freemarker template |
||||
<#include "RPTA-Makros"/> |
||||
<sqlvars> |
||||
<sqlvar name="sos_stud_astat_exists"> |
||||
select count(*) from rpta_resultset where uniquename='sos_stud_astat'; |
||||
</sqlvar> |
||||
</sqlvars> |
||||
<#assign rpta_column_layout = {"uniquename":"sos_stud_stat_geschl_staat", |
||||
"caption":"Studierendenstatistik nach Staatsang., Geschl. etc.", |
||||
"rpta_resultset":"sos_stud_astat", |
||||
"whereclause":"", |
||||
"description":"Studierendenstatistik (Staat, Geschl., Fachsem.)" |
||||
} |
||||
/> |
||||
|
||||
<#assign rpta_columns = [ |
||||
|
||||
{"uniquename":"dim_studiengang_fb", |
||||
"caption":"FB", |
||||
"srcfieldname":"dim_studiengang_fb", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"format_code":"INT_NO_SEP", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Fachbereich" |
||||
}, |
||||
{"uniquename":"dim_studiengang_fb_str", |
||||
"caption":"FB-Name", |
||||
"srcfieldname":"dim_studiengang_fb_str", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"format_code":"", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Fachbereichname" |
||||
}, |
||||
{"uniquename":"dim_studiengang_stg_str", |
||||
"caption":"Studienfach", |
||||
"srcfieldname":"dim_studiengang_stg_str", |
||||
"targetfieldname":"", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case |
||||
when (select lower(druck) from cifx where key=40 and apnr=stufrm) like ''%dual%'' and dim_studiengang_stg=''IBS'' and dim_studiengang_vertfg=''ENG'' then trim(dim_studiengang_stg_str)|| '' (dual, englischsprachig)'' |
||||
when (select lower(druck) from cifx where key=40 and apnr=stufrm) like ''%dual%'' and (select sprache from cifx where key=30 and apnr=dim_studiengang_stg) =''5'' then trim(dim_studiengang_stg_str)|| '' (dual, englischsprachig)'' |
||||
when (select sprache from cifx where key=30 and apnr=dim_studiengang_stg) =''5'' then trim(dim_studiengang_stg_str)|| '' (englischsprachig)'' |
||||
when (select lower(druck) from cifx where key=40 and apnr=stufrm) like ''%dual%'' then trim(dim_studiengang_stg_str)|| '' (dual)'' |
||||
when dim_studiengang_stg=''IBS'' and dim_studiengang_vertfg=''ENG'' then trim(dim_studiengang_stg_str)|| '' (englischsprachig)'' |
||||
else dim_studiengang_stg_str end", |
||||
"is_visible":"1", |
||||
"format_code":"", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Name des Studienfachs" |
||||
}, |
||||
{"uniquename":"dim_studiengang_abschluss", |
||||
"caption":"abschl", |
||||
"srcfieldname":"dim_studiengang_abschluss", |
||||
"targetfieldname":"", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"format_code":"", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Abschluss" |
||||
}, |
||||
{"uniquename":"dim_studiengang_abschlussart", |
||||
"caption":"abschlussart", |
||||
"srcfieldname":"dim_studiengang_abschlussart", |
||||
"targetfieldname":"", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"format_code":"", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Abschlussart" |
||||
}, |
||||
{"uniquename":"dim_studiengang_stg", |
||||
"caption":"stg", |
||||
"srcfieldname":"dim_studiengang_stg", |
||||
"targetfieldname":"", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"format_code":"", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Fach" |
||||
}, |
||||
{"uniquename":"stuart", |
||||
"caption":"St.-Art", |
||||
"srcfieldname":"stuart", |
||||
"targetfieldname":"", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"(select druck from cifx where key=616 and apnr=stuart)", |
||||
"is_visible":"1", |
||||
"format_code":"", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Studienart" |
||||
}, |
||||
{"uniquename":"dim_studiengang_regel", |
||||
"caption":"RSZ", |
||||
"srcfieldname":"dim_studiengang_regel", |
||||
"targetfieldname":"", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"", |
||||
"is_visible":"1", |
||||
"format_code":"", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Regelstudienzeit" |
||||
}, |
||||
{"uniquename":"gesamt", |
||||
"caption":"gesamt", |
||||
"srcfieldname":"summe", |
||||
"column_type":"physicalColumn", |
||||
"col_function":"sum", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Studierende gesamt" |
||||
}, |
||||
{"uniquename":"gesamt_nw", |
||||
"caption":"g_nw", |
||||
"srcfieldname":"summe_nw", |
||||
"targetfieldname":"summe_nw", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when geschlecht<>2 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Studierende gesamt nicht weiblich" |
||||
}, |
||||
{"uniquename":"gesamt_w", |
||||
"caption":"g_w", |
||||
"srcfieldname":"summe_w", |
||||
"targetfieldname":"summe_w", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when geschlecht=2 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Studierende gesamt weiblich" |
||||
}, |
||||
{"uniquename":"gesamt_neue", |
||||
"caption":"neue", |
||||
"srcfieldname":"summe_neue", |
||||
"targetfieldname":"summe_neue", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when kz_rueck_beur_ein in (1,2) then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Neu- und Ersteinschreiber im Studiengang" |
||||
}, |
||||
{"uniquename":"gesamt_neue_nw", |
||||
"caption":"neue_nw", |
||||
"srcfieldname":"summe_neue_nw", |
||||
"targetfieldname":"summe_neue_nw", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when geschlecht<>2 and kz_rueck_beur_ein in (1,2) then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"nicht weibliche Neu- und Ersteinschreiber im Studiengang" |
||||
}, |
||||
{"uniquename":"gesamt_neue_w", |
||||
"caption":"neue_w", |
||||
"srcfieldname":"summe_neue_w", |
||||
"targetfieldname":"summe_neue_w", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when geschlecht=2 and kz_rueck_beur_ein in (1,2) then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"weibliche Neu- und Ersteinschreiber im Studiengang" |
||||
}, |
||||
{"uniquename":"deutsche", |
||||
"caption":"deutsche", |
||||
"srcfieldname":"summe_deutsche", |
||||
"targetfieldname":"summe_deutsche", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende" |
||||
}, |
||||
{"uniquename":"d_nw", |
||||
"caption":"d_nw", |
||||
"srcfieldname":"summe_d_nw", |
||||
"targetfieldname":"summe_d_nw", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat=0 and geschlecht<>2 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche nicht weibliche Studierende" |
||||
}, |
||||
{"uniquename":"d_w", |
||||
"caption":"d_w", |
||||
"srcfieldname":"summe_d_w", |
||||
"targetfieldname":"summe_d_w", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat=0 and geschlecht=2 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche weibliche Studierende" |
||||
}, |
||||
{"uniquename":"d_nw1h", |
||||
"caption":"d_nw1h", |
||||
"srcfieldname":"summe_d_nw1h", |
||||
"targetfieldname":"summe_d_nw1h", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat=0 and geschlecht<>2 and hssem=1 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche nicht weibliche Studierende im 1. Hochschulsemester" |
||||
}, |
||||
{"uniquename":"d_w1h", |
||||
"caption":"d_w1h", |
||||
"srcfieldname":"summe_d_w1h", |
||||
"targetfieldname":"summe_d_w1h", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat=0 and geschlecht=2 and hssem=1 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche weibliche Studierende im 1. Hochschulsemester" |
||||
}, |
||||
{"uniquename":"d_nw1f", |
||||
"caption":"d_nw1f", |
||||
"srcfieldname":"summe_d_nw1f", |
||||
"targetfieldname":"summe_d_nw1f", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat=0 and geschlecht<>2 and fach_sem_zahl=1 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche nicht weibliche Studierende im 1. Fachsemester" |
||||
}, |
||||
{"uniquename":"d_w1f", |
||||
"caption":"d_w1f", |
||||
"srcfieldname":"summe_d_w1f", |
||||
"targetfieldname":"summe_d_w1f", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat=0 and geschlecht=2 and fach_sem_zahl=1 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche weibliche Studierende im 1. Fachsemester" |
||||
}, |
||||
{"uniquename":"ausl", |
||||
"caption":"ausl", |
||||
"srcfieldname":"summe_ausl", |
||||
"targetfieldname":"summe_ausl", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausländische Studierende" |
||||
}, |
||||
{"uniquename":"a_nw", |
||||
"caption":"a_nw", |
||||
"srcfieldname":"summe_a_nw", |
||||
"targetfieldname":"summe_a_nw", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat<>0 and geschlecht<>2 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausländische nicht weibliche Studierende" |
||||
}, |
||||
{"uniquename":"a_w", |
||||
"caption_der_spalte":"Ausländische weibliche Studierende", |
||||
"caption_der_ergebnistabelle":"Ausländische weibliche Studierende", |
||||
"srcfieldname":"summe_a_w", |
||||
"targetfieldname":"summe_a_w", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat<>0 and geschlecht=2 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausländische weibliche Studierende" |
||||
}, |
||||
{"uniquename":"a_nw1h", |
||||
"caption":"a_nw1h", |
||||
"srcfieldname":"summe_a_nw1h", |
||||
"targetfieldname":"summe_a_nw1h", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat<>0 and geschlecht<>2 and hssem=1 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausländische nicht weibliche Studierende im 1. Hochschulsemester" |
||||
}, |
||||
{"uniquename":"a_w1h", |
||||
"caption":"a_w1h", |
||||
"srcfieldname":"summe_a_w1h", |
||||
"targetfieldname":"summe_a_w1h", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat<>0 and geschlecht=2 and hssem=1 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausländische weibliche Studierende im 1. Hochschulsemester" |
||||
}, |
||||
{"uniquename":"a_nw1f", |
||||
"caption":"a_nw1f", |
||||
"srcfieldname":"summe_a_nw1f", |
||||
"targetfieldname":"summe_a_nw1f", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat<>0 and geschlecht<>2 and fach_sem_zahl=1 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausländische nicht weibliche Studierende im 1. Fachsemester" |
||||
}, |
||||
{"uniquename":"a_w1f", |
||||
"caption":"a_w1f", |
||||
"srcfieldname":"summe_a_w1f", |
||||
"targetfieldname":"summe_a_w1f", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat<>0 and geschlecht=2 and fach_sem_zahl=1 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausländische weibliche Studierende im 1. Fachsemester" |
||||
}, |
||||
{"uniquename":"HS1", |
||||
"caption":"HS1", |
||||
"srcfieldname":"summe_HS1", |
||||
"targetfieldname":"summe_HS1", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when hssem=1 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Studierende im 1. Hochschulsemester" |
||||
}, |
||||
{"uniquename":"FS1_d", |
||||
"caption":"FS1_d", |
||||
"srcfieldname":"summe_FS1_d", |
||||
"targetfieldname":"summe_FS1_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=1 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 1. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS1_a", |
||||
"caption":"FS1_a", |
||||
"srcfieldname":"summe_FS1_a", |
||||
"targetfieldname":"summe_FS1_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=1 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 1. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS2_d", |
||||
"caption":"FS2_d", |
||||
"srcfieldname":"summe_FS2_d", |
||||
"targetfieldname":"summe_FS2_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=2 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 2. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS2_a", |
||||
"caption":"FS2_a", |
||||
"srcfieldname":"summe_FS2_a", |
||||
"targetfieldname":"summe_FS2_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=2 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 2. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS3_d", |
||||
"caption":"FS3_d", |
||||
"srcfieldname":"summe_FS3_d", |
||||
"targetfieldname":"summe_FS3_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=3 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 3. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS3_a", |
||||
"caption":"FS3_a", |
||||
"srcfieldname":"summe_FS3_a", |
||||
"targetfieldname":"summe_FS3_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=3 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 3. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS4_d", |
||||
"caption":"FS4_d", |
||||
"srcfieldname":"summe_FS4_d", |
||||
"targetfieldname":"summe_FS4_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=4 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 4. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS4_a", |
||||
"caption":"FS4_a", |
||||
"srcfieldname":"summe_FS4_a", |
||||
"targetfieldname":"summe_FS4_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=4 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 4. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS5_d", |
||||
"caption":"FS5_d", |
||||
"srcfieldname":"summe_FS5_d", |
||||
"targetfieldname":"summe_FS5_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=5 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 5. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS5_a", |
||||
"caption":"FS5_a", |
||||
"srcfieldname":"summe_FS5_a", |
||||
"targetfieldname":"summe_FS5_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=5 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 5. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS6_d", |
||||
"caption":"FS6_d", |
||||
"srcfieldname":"summe_FS6_d", |
||||
"targetfieldname":"summe_FS6_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=6 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 6. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS6_a", |
||||
"caption":"FS6_a", |
||||
"srcfieldname":"summe_FS6_a", |
||||
"targetfieldname":"summe_FS6_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=6 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 6. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS7_d", |
||||
"caption":"FS7_d", |
||||
"srcfieldname":"summe_FS7_d", |
||||
"targetfieldname":"summe_FS7_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=7 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 7. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS7_a", |
||||
"caption":"FS7_a", |
||||
"srcfieldname":"summe_FS7_a", |
||||
"targetfieldname":"summe_FS7_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=7 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 7. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS8_d", |
||||
"caption":"FS8_d", |
||||
"srcfieldname":"summe_FS8_d", |
||||
"targetfieldname":"summe_FS8_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=8 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 8. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS8_a", |
||||
"caption":"FS8_a", |
||||
"srcfieldname":"summe_FS8_a", |
||||
"targetfieldname":"summe_FS8_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=8 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 8. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS9_d", |
||||
"caption":"FS9_d", |
||||
"srcfieldname":"summe_FS9_d", |
||||
"targetfieldname":"summe_FS9_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=9 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 9. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS9_a", |
||||
"caption":"FS9_a", |
||||
"srcfieldname":"summe_FS9_a", |
||||
"targetfieldname":"summe_FS9_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=9 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 9. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS10_d", |
||||
"caption":"FS10_d", |
||||
"srcfieldname":"summe_FS10_d", |
||||
"targetfieldname":"summe_FS10_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=10 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 10. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS10_a", |
||||
"caption":"FS10_a", |
||||
"srcfieldname":"summe_FS10_a", |
||||
"targetfieldname":"summe_FS10_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=10 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 10. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS11_d", |
||||
"caption":"FS11_d", |
||||
"srcfieldname":"summe_FS11_d", |
||||
"targetfieldname":"summe_FS11_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=11 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende im 11. Fachsemester" |
||||
}, |
||||
{"uniquename":"FS11_a", |
||||
"caption":"FS11_a", |
||||
"srcfieldname":"summe_FS11_a", |
||||
"targetfieldname":"summe_FS11_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl=11 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende im 11. Fachsemester" |
||||
}, |
||||
{"uniquename":"FSg11_d", |
||||
"caption":"FS>11_d", |
||||
"srcfieldname":"summe_FSg11_d", |
||||
"targetfieldname":"summe_FSg11_d", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl>11 and ca12_staat=0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"deutsche Studierende mit mehr als 11 Fachsemestern" |
||||
}, |
||||
{"uniquename":"FSg11_a", |
||||
"caption":"FS>11_a", |
||||
"srcfieldname":"summe_FSg11_a", |
||||
"targetfieldname":"summe_FSg11_a", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl>11 and ca12_staat<>0 then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"ausl. Studierende mit mehr als 11 Fachsemestern" |
||||
}, |
||||
{"uniquename":"SRSZw", |
||||
"caption":"SRSZw", |
||||
"srcfieldname":"summe_SRSZw", |
||||
"targetfieldname":"summe_SRSZw", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when geschlecht=2 and fach_sem_zahl<=dim_studiengang_regel then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Studierende in der Regelstudienzeit weiblich" |
||||
}, |
||||
{"uniquename":"SRSZD", |
||||
"caption":"SRSZD", |
||||
"srcfieldname":"summe_SRSZD", |
||||
"targetfieldname":"summe_SRSZD", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when ca12_staat=0 and fach_sem_zahl<=dim_studiengang_regel then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Studierende in der Regelstudienzeit deutsch" |
||||
}, |
||||
{"uniquename":"SRSZgesamt", |
||||
"caption":"SRSZgesamt", |
||||
"srcfieldname":"summe_SRSZgesamt", |
||||
"targetfieldname":"summe_SRSZgesamt", |
||||
"column_type":"logicalColumn", |
||||
"col_function":"case when fach_sem_zahl<=dim_studiengang_regel then summe else 0 end", |
||||
"is_visible":"1", |
||||
"visible_size":"5", |
||||
"is_aggregate":"1", |
||||
"description":"Studierende in der Regelstudienzeit gesamt" |
||||
}, |
||||
{"uniquename":"SRSZquote", |
||||
"caption":"SRSZ in %", |
||||
"srcfieldname":"summe_SRSZquote", |
||||
"targetfieldname":"summe_SRSZquote", |
||||
"column_type":"computedColumn", |
||||
"col_function":"((100.00 * summe_SRSZgesamt) / summe)", |
||||
"is_visible":"1", |
||||
"format_code":"INT_PERCENT", |
||||
"visible_size":"5", |
||||
"is_aggregate":"0", |
||||
"description":"Anteil Studierender in der Regelstudienzeit" |
||||
} |
||||
|
||||
] |
||||
/> |
||||
|
||||
<@rpta_column_layout_fuellen /> |
@ -0,0 +1,450 @@
@@ -0,0 +1,450 @@
|
||||
--freemarker template |
||||
<sqlvars> |
||||
<sqlvar name="sos_stg_aggr_exists"> |
||||
select sp_table_exists('sos_stg_aggr') from xdummy; |
||||
</sqlvar> |
||||
<sqlvar name="fact_table_source"> |
||||
select name |
||||
from sx_tables where name ='sos_stg_aggr' |
||||
|
||||
</sqlvar> |
||||
<sqlvar name="added_tables" type="hashsequence"> |
||||
select 1::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'dim_studiengang.tid=sos_stg_aggr.tid_stg' as joinclause |
||||
from sx_tables where name in ('dim_studiengang') |
||||
union |
||||
select 10::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'dim_studiengang.stort=sos_k_stort.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_stort') |
||||
union |
||||
select 20::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sos_stg_aggr.stutyp=sos_k_stutyp.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_stutyp') |
||||
union |
||||
select 30::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sos_stg_aggr.stuart=sos_k_stuart.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_stuart') |
||||
union |
||||
select 40::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sos_stg_aggr.stufrm=sos_k_stufrm.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_stufrm') |
||||
union |
||||
select 50::smallint as sortnr, |
||||
name, trim(name) ||'_' as prefix, |
||||
caption, |
||||
'sos_stg_aggr.hrst=sos_k_hrst.apnr' as joinclause |
||||
from sx_tables where name in ('sos_k_hrst') |
||||
order by 1 |
||||
</sqlvar> |
||||
<sqlvar name="fields_target" type="hashsequence"><![CDATA[ |
||||
<#if fact_table_source?exists> |
||||
select tid, table_name, |
||||
name, |
||||
name as targetname |
||||
from sx_fields where table_name ='${fact_table_source}' |
||||
and currentlyused=1 |
||||
<#foreach added_table in added_tables> |
||||
union |
||||
select tid,table_name, |
||||
name, |
||||
'${added_table.prefix}' || name as targetname |
||||
from sx_fields where table_name ='${added_table.name}' |
||||
and currentlyused=1 |
||||
and name in ('fach_sem_zahl','hs','summe') |
||||
</#foreach> |
||||
order by 1 |
||||
</#if> |
||||
]]> |
||||
</sqlvar> |
||||
</sqlvars> |
||||
|
||||
<#if sos_stg_aggr_exists==1 && fact_table_source?exists > |
||||
|
||||
<#assign fact_table_target = {"name":"sos_stud_astat_dashboard", "caption":"Studierende (Fachsem., HS-Sem., Studiengang) Dashboard"} |
||||
/> |
||||
|
||||
|
||||
CREATE temp table tmp_tables( |
||||
name CHAR(255) , |
||||
caption CHAR(255) , |
||||
description CHAR(255) , |
||||
table_type CHAR(255) , |
||||
systeminfo_id INTEGER , |
||||
systeminfo_orig INTEGER , |
||||
thema CHAR(255) , |
||||
sachgebiete_id CHAR(255) |
||||
); |
||||
CREATE temp TABLE tmp_fields( |
||||
tid serial NOT NULL, |
||||
table_name VARCHAR(255) not null, |
||||
name VARCHAR(255) not null, |
||||
caption VARCHAR(255) , |
||||
description VARCHAR(255) , |
||||
field_type VARCHAR(255) not null, |
||||
field_size VARCHAR(255) , |
||||
field_not_null smallint, |
||||
currentlyused SMALLINT , |
||||
is_primarykey SMALLINT default 0 , |
||||
foreignkey_tab VARCHAR(255) , |
||||
foreignkey_col VARCHAR(255) , |
||||
foreignkey_int VARCHAR(255) , |
||||
foreignkey_cap VARCHAR(255) , |
||||
foreignkey_cond VARCHAR(255) , |
||||
foreignkey_func VARCHAR(255) , |
||||
check_integrity SMALLINT, |
||||
is_sum SMALLINT default 1, |
||||
foreignkey_uniquename VARCHAR(255) |
||||
|
||||
); |
||||
|
||||
|
||||
--Vorbereitung: |
||||
UPDATE sx_tables |
||||
SET caption = 'Standorte' |
||||
WHERE name='sos_k_stort'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Studienart' |
||||
WHERE name = 'sos_k_stuart'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Studiumstyp' |
||||
WHERE name = 'sos_k_stutyp'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Studienform' |
||||
WHERE name = 'sos_k_stufrm'; |
||||
UPDATE sx_tables |
||||
SET caption = 'Hörerstatus' |
||||
WHERE name = 'sos_k_hrst'; |
||||
|
||||
|
||||
|
||||
--drop view if exists sos_stud_astat; |
||||
|
||||
|
||||
drop VIEW sos_k_stutyp; |
||||
|
||||
CREATE VIEW sos_k_stutyp |
||||
( |
||||
apnr, |
||||
druck, |
||||
astat |
||||
) |
||||
AS |
||||
SELECT cifx.apnr, |
||||
cifx.druck, |
||||
astat |
||||
FROM cifx |
||||
WHERE cifx.key = 40; |
||||
|
||||
|
||||
update sx_fields set |
||||
is_sum=0 |
||||
where table_name='sos_stg_aggr' |
||||
and name!='summe'; |
||||
update sx_fields set |
||||
is_sum=1 |
||||
where table_name='sos_stg_aggr' |
||||
and name='summe'; |
||||
|
||||
|
||||
insert into tmp_tables ( |
||||
name, |
||||
caption, |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
) |
||||
select |
||||
'${fact_table_target.name}', |
||||
'${fact_table_target.caption}', |
||||
description, |
||||
table_type, |
||||
systeminfo_id, |
||||
thema, |
||||
sachgebiete_id |
||||
from sx_tables where name='${fact_table_source}' |
||||
; |
||||
|
||||
|
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${fact_table_source}' |
||||
and currentlyused=1; |
||||
<#foreach added_table in added_tables> |
||||
insert into tmp_fields (table_name, |
||||
name, |
||||
caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename) |
||||
select '${fact_table_target.name}' as table_name, |
||||
'${added_table.prefix}' || name, |
||||
'${added_table.caption}: ' || caption, |
||||
description, |
||||
field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyused, |
||||
is_primarykey, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_int, |
||||
foreignkey_cap, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
from sx_fields where table_name ='${added_table.name}' |
||||
and currentlyused=1; |
||||
</#foreach> |
||||
|
||||
CREATE temp TABLE tmp_rpta_resultset |
||||
( |
||||
caption varchar(255), |
||||
uniquename varchar(255), |
||||
fieldclause text, |
||||
joinclause text, |
||||
whereclause text, |
||||
systeminfo_id integer |
||||
); |
||||
|
||||
insert into tmp_rpta_resultset(caption, |
||||
uniquename, |
||||
systeminfo_id) |
||||
select '${fact_table_target.caption}', |
||||
'${fact_table_target.name}', |
||||
7 |
||||
; |
||||
|
||||
|
||||
update tmp_rpta_resultset set fieldclause=' |
||||
<#foreach field_target in fields_target> |
||||
${field_target.table_name}.${field_target.name} as ${field_target.targetname}, |
||||
</#foreach> |
||||
null::varchar as dummy', |
||||
joinclause='${fact_table_source} |
||||
<#foreach added_table in added_tables> |
||||
left outer join ${added_table.name} on (${added_table.joinclause}) |
||||
</#foreach>'; |
||||
|
||||
select * into temp tmp_rs1 |
||||
from rpta_resultset |
||||
; |
||||
|
||||
update rpta_resultset set caption=T.caption, |
||||
fieldclause=T.fieldclause, |
||||
joinclause=T.joinclause, |
||||
whereclause=T.whereclause |
||||
from tmp_rpta_resultset T |
||||
where T.systeminfo_id=rpta_resultset.systeminfo_id |
||||
and T.uniquename=rpta_resultset.uniquename |
||||
; |
||||
|
||||
insert into rpta_resultset(caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id) |
||||
select caption, |
||||
uniquename, |
||||
fieldclause, |
||||
joinclause, |
||||
whereclause, |
||||
systeminfo_id |
||||
from tmp_rpta_resultset |
||||
where 0=(select count(*) |
||||
from tmp_rs1 T |
||||
where T.systeminfo_id=tmp_rpta_resultset.systeminfo_id |
||||
and T.uniquename=tmp_rpta_resultset.uniquename) |
||||
; |
||||
drop table tmp_rpta_resultset; |
||||
drop table tmp_rs1; |
||||
|
||||
delete from sx_tables where name |
||||
in (select T.name from tmp_tables T); |
||||
|
||||
insert into sx_tables (name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id) |
||||
select name,caption,description,table_type,systeminfo_id,systeminfo_orig,thema,sachgebiete_id |
||||
from tmp_tables; |
||||
|
||||
|
||||
delete from sx_fields where table_name |
||||
in (select T.table_name from tmp_fields T); |
||||
|
||||
insert into sx_fields (table_name,name,caption,description,field_type, |
||||
field_size, |
||||
field_not_null, |
||||
currentlyUsed, |
||||
foreignkey_tab, |
||||
foreignkey_col, |
||||
foreignkey_cap, |
||||
foreignkey_int, |
||||
foreignkey_cond, |
||||
foreignkey_func, |
||||
check_integrity, |
||||
is_sum, |
||||
foreignkey_uniquename |
||||
) |
||||
select |
||||
F.table_name,F.name,F.caption,F.description,F.field_type, |
||||
F.field_size, |
||||
F.field_not_null, |
||||
F.currentlyUsed, |
||||
F.foreignkey_tab, |
||||
F.foreignkey_col, |
||||
F.foreignkey_cap, |
||||
F.foreignkey_int, |
||||
F.foreignkey_cond, |
||||
F.foreignkey_func, |
||||
F.check_integrity, |
||||
F.is_sum, |
||||
F.foreignkey_uniquename |
||||
|
||||
from tmp_fields F; |
||||
|
||||
|
||||
drop table tmp_fields; |
||||
drop table tmp_tables; |
||||
|
||||
|
||||
--rpta_column füllen: |
||||
select * into temp tmp_rc1 |
||||
from rpta_column; |
||||
|
||||
|
||||
create temp table tmp_rpta_column( |
||||
uniquename varchar(255) NOT NULL, |
||||
caption varchar(255), |
||||
srcfieldname varchar(255), |
||||
column_type integer, |
||||
col_function text, |
||||
is_aggregate smallint, |
||||
resultset_id integer, |
||||
description text, |
||||
custom integer default 0 |
||||
); |
||||
|
||||
insert into tmp_rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description) |
||||
select F.name as uniquename, |
||||
coalesce(T.caption,T.name) || ' - ' || F.caption, |
||||
F.name as srcfieldname, |
||||
1 as column_type, |
||||
(case when F.is_sum=1 then 'sum' else null::varchar end) as col_function, |
||||
(case when F.is_sum=1 then 1 else 0 end) as is_aggregate, |
||||
R.tid as resultset_id, |
||||
F.description |
||||
from rpta_resultset R, sx_fields F left outer join sx_tables T on (T.name=F.table_name) |
||||
where F.table_name='${fact_table_target.name}' |
||||
and R.uniquename='${fact_table_target.name}' |
||||
and F.currentlyused=1 |
||||
; |
||||
|
||||
update rpta_column set |
||||
caption=T.caption, |
||||
srcfieldname=T.srcfieldname, |
||||
column_type=T.column_type, |
||||
col_function=T.col_function, |
||||
is_aggregate=T.is_aggregate, |
||||
resultset_id=R.tid, |
||||
description=T.description, |
||||
custom=T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where T.uniquename=rpta_column.uniquename |
||||
and rpta_column.resultset_id=R.tid |
||||
and R.uniquename='${fact_table_target.name}' |
||||
; |
||||
insert into rpta_column( uniquename, |
||||
caption, |
||||
srcfieldname, |
||||
column_type, |
||||
col_function, |
||||
is_aggregate, |
||||
resultset_id, |
||||
description, |
||||
custom) |
||||
select T.uniquename, |
||||
T.caption, |
||||
T.srcfieldname, |
||||
T.column_type, |
||||
T.col_function, |
||||
T.is_aggregate, |
||||
R.tid as resultset_id, |
||||
T.description, |
||||
T.custom |
||||
from tmp_rpta_column T, rpta_resultset R |
||||
where R.uniquename='${fact_table_target.name}' |
||||
and 0=(select count(*) from tmp_rc1 C |
||||
where C.uniquename=T.uniquename |
||||
and C.resultset_id=R.tid) |
||||
; |
||||
|
||||
drop table tmp_rpta_column; |
||||
drop table tmp_rc1; |
||||
|
||||
</#if> --wenn sos_stg_aggr_exists=1 |
Loading…
Reference in new issue