You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
114 lines
3.7 KiB
114 lines
3.7 KiB
48280^SuperX-Connect Kennzahlen^--Freemarker Template\ |
|
<#include "SQL_lingua_franca"/>\ |
|
<#include "SuperX_general"/>\ |
|
--\ |
|
--Autor D. Quathamer 2024\ |
|
<sqlvars>\ |
|
<sqlvar name="my_base_rs"><![CDATA[\ |
|
select R.uniquename\ |
|
from rpta_resultset R, rpta_column_layout L\ |
|
where L.resultset_id=R.tid\ |
|
and L.uniquename=<<Spaltenlayout>>;]]>\ |
|
</sqlvar>\ |
|
<sqlvar name="basetable" type="hash"><![CDATA[\ |
|
SELECT distinct name,\ |
|
0::smallint as is_virtual,\ |
|
name as runtime_tablename\ |
|
from sx_tables\ |
|
where name in ('${my_base_rs}')\ |
|
and 0=(select count(*) from rpta_resultset R where R.uniquename='${my_base_rs}')\ |
|
union\ |
|
select R.uniquename,\ |
|
1::smallint as is_virtual,\ |
|
'tmp_' || R.uniquename as runtime_tablename\ |
|
from rpta_resultset R where R.uniquename='${my_base_rs}'\ |
|
;\ |
|
]]>\ |
|
</sqlvar>\ |
|
<sqlvar name="rpta_resultset" type="hash"><![CDATA[\ |
|
select * from rpta_resultset\ |
|
where uniquename='${basetable.name}';\ |
|
\ |
|
]]></sqlvar>\ |
|
<sqlvar name="rpta_column_layout" type="hash"><![CDATA[\ |
|
SELECT * from sp_rpta_column_layout('${basetable.name}',<<Spaltenlayout>>::varchar(255));\ |
|
\ |
|
]]></sqlvar>\ |
|
<sqlvar name="columns" type="hashsequence"><![CDATA[\ |
|
SELECT * from sp_rpta_columns_in_layout(<<Spaltenlayout>>::varchar(255))\ |
|
where 1=1\ |
|
/* and column_uniquename in (<<Spalten>>) */\ |
|
order by sortnr\ |
|
;\ |
|
]]></sqlvar>\ |
|
<sqlvar name="endsemester"><![CDATA[\ |
|
SELECT max(tid)\ |
|
from semester \ |
|
where 1=1\ |
|
/* and tid >= <<Startsemester>> */\ |
|
/* and tid <= <<Endsemester>> */\ |
|
<#if "<<Semestertyp>>"="1" || "<<Semestertyp>>"="2">\ |
|
and substring('' || tid from 5 for 1)='<<Semestertyp>>'\ |
|
</#if>\ |
|
;\ |
|
\ |
|
]]></sqlvar>\ |
|
\ |
|
</sqlvars>\ |
|
\ |
|
<#assign jahr_param="" />\ |
|
<#assign jahr_filter="1=1" />\ |
|
/* <#assign jahr_param="<<Jahr>>" /> */\ |
|
--Akad. Jahr 2022: WS + SS - Beispiel: WS 22/23 + SS 2023\ |
|
<#if jahr_param !="">\ |
|
<#assign jahr_filter="(" />\ |
|
<#assign jahr_filter=jahr_filter + "(substring('' || sem from 5 for 1)='2' and val(substring('' || sem_rueck_beur_ein from 1 for 4))="+jahr_param+")" />\ |
|
<#assign jahr_filter=jahr_filter + " or "/>\ |
|
<#assign jahr_filter=jahr_filter + "(substring('' || sem from 5 for 1)='1' and (val(substring('' || sem_rueck_beur_ein from 1 for 4))-1)="+jahr_param+")" />\ |
|
<#assign jahr_filter=jahr_filter + ")" />\ |
|
</#if>\ |
|
\ |
|
<#assign filter="1=1\ |
|
/* and hs_nr in (<<Hochschule>>) */\ |
|
/* and geschlecht=<<Geschlecht>> */\ |
|
/* and sxc_katalog.id in (<<Kennzahl>>) */ \ |
|
/* and jahr >= <<Start-Jahr>> */\ |
|
/* and jahr <= <<End-Jahr>> */\ |
|
/* and generic_dim1 in (select object_value from sxc_mapping_bestand where target_value=<<Lehr- und Forschungsbereich>>) */\ |
|
" />\ |
|
\ |
|
\ |
|
\ |
|
<#if columns?has_content>\ |
|
\ |
|
<#if basetable.is_virtual==1>\ |
|
\ |
|
create temp table ${basetable.runtime_tablename} as\ |
|
select ${rpta_resultset.fieldclause} \ |
|
from ${rpta_resultset.joinclause} \ |
|
where 1=1\ |
|
<#if rpta_resultset.whereclause != ""> \ |
|
${rpta_resultset.whereclause} </#if>\ |
|
and ${filter}\ |
|
;\ |
|
</#if>\ |
|
\ |
|
\ |
|
\ |
|
<@rpta_interpret_column_layout nonvirtualTableFilter=filter/>\ |
|
\ |
|
\ |
|
</#if> --wenn columns?has_content^--Freemarker Template\ |
|
XIL List\ |
|
sizable_columns horizontal_scrolling\ |
|
drop_and_delete movable_columns \ |
|
white_space_color=COLOR_WHITE fixed_columns=1\ |
|
min_heading_height=55\ |
|
<#foreach column in columns>\ |
|
<#if column.is_visible!=0>\ |
|
Column CID=0 heading_text="${column.caption}" center_heading explanation="${column.description}"\ |
|
row_selectable heading_platform readonly\ |
|
width=${column.visible_width} text_size=60\ |
|
</#if>\ |
|
</#foreach>\ |
|
@@@^ ^ ^Übersicht über vorberechnete Kennzahlen^drop table if exists tmp_stud2; drop table if exists tmp_stud3;^^1^600^360^^0^<<SQL>>SELECT description FROM rpta_column_layout where uniquename=<<Spaltenlayout>>;^
|
|
|