a.binder 7 年 前
コミット
d64def4fb7

+ 145 - 0
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats.xsl

@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+    xmlns:default_db__x3A__BI_audit_ENERGA_RUM_UMOWY="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_UMOWY"
+    xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA="https://biuro.biall-net.pl/wfs/default_db/ENERGA_RUM_KONTRAHENCI_POWIAZANIA"
+    xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
+    exclude-result-prefixes="xs"
+    version="2.0">
+    
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    
+    
+    <xsl:include href="graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl"/>
+    
+    
+    
+    <xsl:template name="p5gnuplot:simpletable__x3A__graph.stats">
+        <xsl:param name="system_cache__dita:context.path.attrs.nodeset" required="yes"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:FieldType" required="no"/>
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:ValueType" required="yes"/><!-- which field value to use  attr -->
+        <xsl:param name="p5gnuplot:simpletable__x3A__graph.stats.group_by" select="$default_db__x3A__BI_audit_BENFORD:FieldType" /><!-- which field value to use  attr -->
+        <xsl:param name="group.root"/>
+        <xsl:param name="group.count"/>
+        <xsl:param name="group.sum"/>
+        <xsl:param name="audience"/>
+        <strow props="graph.stats">
+            
+            <xsl:choose>
+                <xsl:when test="string-length($group.root) &gt;0">
+                    <xsl:variable name="current-group.parent.count" select="count(current-group())"/>
+                    <xsl:for-each-group select="$system_cache__dita:context.path.attrs.nodeset/*/*" group-by="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]">
+                        <xsl:sort select="@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]" order="ascending"/>
+                        <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="count(current-group())"/></stentry>-->
+                        <!--<stentry audience="rozklad_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/></stentry>-->
+                        
+                        
+                        <stentry props="group.root" audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}" ><xsl:call-template name="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs"/>
+                            <xsl:call-template name="p5gnuplot:set.graph.group">
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                <xsl:with-param name="group__x3A__value" select="$group.root"/>
+                            </xsl:call-template>
+                            <xsl:for-each select="current-group()">
+                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                </xsl:apply-templates>
+                            </xsl:for-each>
+                            <!--<xsl:value-of select="sum(current-group()/*[@default_db__x3A__BI_audit_BENFORD:leadingNumber]/number())"/>--></stentry>
+                        
+                        <xsl:for-each-group select="current-group()" group-by="@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]"><!-- todo other -->
+                            <xsl:sort select="number(@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ])" data-type="number" order="ascending"/>
+                            <stentry props="group.count" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">
+                                <xsl:call-template name="p5gnuplot:set.graph.group">
+                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                    <xsl:with-param name="group__x3A__value" select="$group.count"/>
+                                </xsl:call-template>
+                                <xsl:for-each select="current-group()">
+                                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                    </xsl:apply-templates>
+                                </xsl:for-each>
+                            </stentry>
+                            <stentry props="group.sum" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
+                                <xsl:call-template name="p5gnuplot:set.graph.group">
+                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                    <xsl:with-param name="group__x3A__value" select="$group.sum"/>
+                                </xsl:call-template>
+                                
+                                <xsl:for-each select="current-group()">
+                                    <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                        <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                        
+                                    </xsl:apply-templates>
+                                </xsl:for-each>
+                            </stentry>
+                        </xsl:for-each-group>
+                    </xsl:for-each-group>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:for-each-group select="$system_cache__dita:context.path.attrs.nodeset/*/*" group-by="@*[name()=$p5gnuplot:simpletable__x3A__graph.stats.group_by]"><!-- todo other -->
+                        <xsl:sort select="number(@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ])" data-type="number" order="ascending"/>
+                        <stentry props="group.count" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}">
+                            <xsl:call-template name="p5gnuplot:set.graph.group">
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                <xsl:with-param name="group__x3A__value" select="$group.count"/>
+                            </xsl:call-template>
+                            <xsl:for-each select="current-group()">
+                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                </xsl:apply-templates>
+                            </xsl:for-each>
+                        </stentry>
+                        <stentry props="group.sum" current-grouping-key="{@*[ name()=$default_db__x3A__BI_audit_BENFORD:ValueType ]}"  audience="{$audience}_{@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]}"><!-- {@*[ name()=$default_db__x3A__BI_audit_BENFORD:FieldType ]} -->
+                            <xsl:call-template name="p5gnuplot:set.graph.group">
+                                <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+                                <xsl:with-param name="group__x3A__value" select="$group.sum"/>
+                            </xsl:call-template>
+                            
+                            <xsl:for-each select="current-group()">
+                                <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats" select=".">
+                                    <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:ValueType"/>
+                                    
+                                </xsl:apply-templates>
+                            </xsl:for-each>
+                        </stentry>
+                    </xsl:for-each-group>
+                </xsl:otherwise>
+            </xsl:choose>
+            
+            
+        </strow>
+    </xsl:template>
+    
+    <xsl:template mode="p5gnuplot:simpletable__x3A__graph.stats" match="@fid">
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:FieldType" required="yes"/>
+        
+        <p5gnuplot:stats props="fid">
+            <xsl:copy-of select="."/>
+            <xsl:attribute name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+            
+            <xsl:apply-templates mode="default_db__x3A__BI_audit_BENFORD:generate__x3A__copy_attrs" select="parent::*/@*"/>
+            <xsl:value-of select="../*[@*[name()=$default_db__x3A__BI_audit_BENFORD:FieldType]]/text()"/><xsl:text></xsl:text><!-- *[@*[name()=$default_db__x3A__BI_audit_BENFORD:ValueType]] -->
+        </p5gnuplot:stats>
+    </xsl:template>
+    
+    
+    <xsl:template mode="p5gnuplot:simpletable__x3A__graph.stats" match="@*"/>
+    <xsl:template mode="p5gnuplot:simpletable__x3A__graph.stats" match="*">
+        <xsl:param name="default_db__x3A__BI_audit_BENFORD:FieldType" required="yes"/>
+        
+        <!--<p5gnuplot:stats>-->
+        <xsl:apply-templates mode="#current" select="@*">
+            <xsl:with-param name="default_db__x3A__BI_audit_BENFORD:FieldType" select="$default_db__x3A__BI_audit_BENFORD:FieldType"/>
+            
+        </xsl:apply-templates>
+        <!--</p5gnuplot:stats>-->
+    </xsl:template>
+    <xsl:template mode="p5gnuplot:simpletable__x3A__graph.stats" match="text()|comment()"/>
+    
+</xsl:stylesheet>

+ 253 - 0
SE/schema/default_db_xml_cache.public/default_db/graph_gnuplot/graph_gnuplot.simpletable__x3A__graph.stats__x3A__analyze.xsl

@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
+    xmlns:system_cache__dita="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/dita.xsd"
+    xmlns:p5gnuplot="http://biuro.biall-net.pl/WPS_Functions/graph_gnuplot"
+    xmlns:default_db__x3A__BI_audit_ENERGA_RUM_UMOWY="https://biuro.biall-net.pl/wfs/default_db/BI_audit_ENERGA_RUM_UMOWY"
+    xmlns:default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA="https://biuro.biall-net.pl/wfs/default_db/ENERGA_RUM_KONTRAHENCI_POWIAZANIA"
+    xmlns:default_db__x3A__BI_audit_BENFORD="https://biuro.biall-net.pl/wfs/default_db/BI_audit_BENFORD"
+    xmlns:Linear_regression="https://en.wikipedia.org/wiki/Linear_regression"
+    exclude-result-prefixes="xs"
+    version="2.0">
+    
+    
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+    
+    
+    
+    
+    
+    <xsl:template name="p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze" >
+        <xsl:param name="p5gnuplot:value"/>
+        <xsl:param name="fileindex" required="yes"/>
+        <xsl:param name="system_cache__dita:element__x3A__parent"  required="yes" />
+        <xsl:param name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y"/><!-- ograniczenie danych dla osi -->
+        <xsl:param name="system_cache__dita:graph.ytics_detect_row"/>
+        <!--example <equation-inline><!-\-#68 p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset-\-><!-\-#88-B found self bypass recurse-\->
+            <ph props="p5gnuplot__file.row.y_241">
+                <equation-inline props="position">3</equation-inline>) </ph>
+            <q props="p5gnuplot.current-grouping-key.xtics">rok|kwartał</q>
+            <ph props="p5gnuplot__file.row.y_241">, <equation-inline props="position">4</equation-inline>) </ph>
+            <q props="p5gnuplot.current-grouping-key.xtics">rok|kwartał</q>
+            <ph props="p5gnuplot__file.row.y_241">, <equation-inline props="position">5</equation-inline>) </ph>
+            <q props="p5gnuplot.current-grouping-key.xtics">rok|kwartał</q>
+            <ph props="p5gnuplot__file.row.y_241">, <equation-inline props="position">6</equation-inline>) </ph>
+            <q props="p5gnuplot.current-grouping-key.xtics">rok|kwartał</q>
+            <ph props="p5gnuplot__file.row.y_241">, <equation-inline props="position">7</equation-inline>) </ph>
+            <q props="p5gnuplot.current-grouping-key.xtics">rok|kwartał</q>
+        </equation-inline>-->
+        <!--<p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze>-->
+            <xsl:apply-templates mode="p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze" select="doc(p5gnuplot:set.graph.stats.xml($fileindex))">
+                <xsl:with-param name="system_cache__dita:element__x3A__parent" select="$system_cache__dita:element__x3A__parent"/>
+                <xsl:with-param name="system_cache__dita:graph.ytics_detect_row" select="$system_cache__dita:graph.ytics_detect_row"/>
+                <xsl:with-param name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y"/>
+                <xsl:with-param name="p5gnuplot:value" select="$p5gnuplot:value"/>
+            </xsl:apply-templates>
+            
+        <!--</p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze>-->
+    </xsl:template>
+    
+    
+    
+    
+    
+    <xsl:template mode="p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze" match="*">
+        <xsl:param name="system_cache__dita:element__x3A__parent"  required="yes" />
+        <xsl:comment>#32 matched = <xsl:value-of select="name()"/></xsl:comment>
+    </xsl:template>
+    
+    <xsl:template mode="p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze" match="strow">
+        <xsl:param name="system_cache__dita:element__x3A__parent"  required="yes" />
+        <xsl:param name="system_cache__dita:graph.ytics_detect_row"  required="yes"/>
+        <xsl:param name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y"  required="yes"/>
+        <xsl:param name="p5gnuplot:value"/>
+        <!--<xsl:for-each-group select="stentry" group-by="@current-grouping-key">-->
+            
+        <xsl:variable name="system_cache__dita:element.next" select="system_cache__dita:element.next($system_cache__dita:element__x3A__parent)"/>
+            
+        
+        <xsl:for-each-group select="stentry/p5gnuplot:stats" group-by="parent::*/@props">
+            <xsl:variable name="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
+                <xsl:call-template name="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
+                    <xsl:with-param name="col" select="parent::*/@col"/>
+                    <xsl:with-param name="system_cache__dita:graph.ytics_detect_row" select="$system_cache__dita:graph.ytics_detect_row"/>
+                    <xsl:with-param name="p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y" select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y"/>
+                </xsl:call-template>
+            </xsl:variable>
+            <xsl:variable name="col" select="parent::*/@col"/>
+            <!--<dd>col=<xsl:value-of select="$col"/>;$p5gnuplot:value=<xsl:value-of select="$p5gnuplot:value"/>;$system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect=<xsl:value-of select="$system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect//@system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect"/>
+                Test:<xsl:value-of select="system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect($system_cache__dita:graph.ytics_detect_row,$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y,$col)"/>
+            </dd>-->
+            
+            
+            
+                <xsl:choose>
+                    <xsl:when test="count(current-group())=0">
+                        <xsl:comment>#88 count  0 </xsl:comment>
+                    </xsl:when>
+                    <xsl:when test="$p5gnuplot:value and $system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect//@system_cache__dita:graph.ytics_detect_row__x3A__if_current_histogram__x3A__detect">
+                        
+                        
+                        
+                        <dlentry>  
+                                        
+                        
+                        <xsl:element name="dt">
+                            <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
+                                Grupa <xsl:value-of select="current-grouping-key()"/> / <xsl:value-of select="@audience"/> / <xsl:value-of select="@group"/>  <!-- fid <xsl:value-of select="@fid"/> col=<xsl:value-of select="parent::*/@col"/> ;  <xsl:value-of select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y//varname[@props='system_cache__dita:graph.ytics_detect_row']/text()"/> -->
+                            </xsl:element>
+                           <!--dla grupy <xsl:value-of select="current-grouping-key()"/>; p5gnuplot:stats/@fid=<xsl:value-of select="p5gnuplot:stats/@fid"/> , name=<xsl:value-of select="name()"/>-->
+                                                <!-- min fid 1 = <xsl:value-of select="current-group()//p5gnuplot:stats/number(text())"/>
+                                        min fid 2 = <xsl:value-of select="current-group()//p5gnuplot:stats/text()"/>
+                                        min fin 22= <xsl:value-of select=".//p5gnuplot:stats"/>
+                                        min fin 23= <xsl:value-of select=".//p5gnuplot:stats/text()"/>
+                                        min fin 2a= <xsl:value-of select="descendant-or-self::p5gnuplot:stats[1]/text()"/>
+                                        min fid 3 = <xsl:value-of select="current-group()//p5gnuplot:stats[ min(number(text())) ]/@fid"/>
+                                        
+                                        min fid 33 = <xsl:value-of select="current-group()//p5gnuplot:stats[ text()=min(current-group()//p5gnuplot:stats/number(text())) ]/@fid"/>
+                                       
+                                        min fid 33vb = <xsl:value-of select="current-group()//p5gnuplot:stats[ text()=min(current-group()//p5gnuplot:stats/number(text())) ]/parent::stentry/@props"/>-->
+                        </xsl:element>
+                        
+                        <dd>
+                            Wartości skrajne 
+                        </dd>
+                        
+                        </dlentry>
+                        <dlentry>
+                            
+                            <dt>
+                                Analiza regresji liniowej 
+                            </dt>
+                            <dd>
+                                <xsl:variable name="Linear_regression:calculate_data">
+                                <xsl:call-template name="Linear_regression:calculate_data">
+                                    <!--<xsl:with-param name="Linear_regression:X_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingNumber</xsl:with-param>-->
+                                    <xsl:with-param name="Linear_regression:X_element__x3A__set">p5gnuplot:stats</xsl:with-param>
+                                    <xsl:with-param name="Linear_regression:Y_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month</xsl:with-param>
+                                    <xsl:with-param name="Linear_regression:dataset" select="current-group()"/>
+                                </xsl:call-template>
+                                </xsl:variable>
+                                <xsl:apply-templates mode="Linear_regression:calculate_data__x3A__to_dita" select="$Linear_regression:calculate_data"/>
+                                <foreign>
+                                    <xsl:copy-of select="$Linear_regression:calculate_data"/>
+                                </foreign>
+                        
+                            </dd>
+                        </dlentry>   
+                        
+                        <xsl:choose>
+                            <xsl:when test="current-group()/text()">
+                                <dlentry>
+                                    <dt>
+                                        min/max
+                                    </dt>
+                                    <xsl:element name="dd">
+                                        <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
+                                            Minimum <xsl:value-of select="system_cache__dita:big_values_format(min(current-group()/number(text())))"/>
+                                            <foreign>current-group()/name()= <xsl:value-of select="current-group()[1]/name()"/> , text()=<xsl:value-of select="text()"/></foreign>
+                                        </xsl:element>
+                                        <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
+                                            <xsl:value-of select="min(current-group()/number(text()))"/> 
+                                            <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
+                                                <xsl:with-param name="fid" select="current-group()[ text()=min(current-group()/number(text())) ][1]/@fid"/>
+                                            </xsl:call-template>
+                                        </xsl:element>
+                                    </xsl:element>
+                                    <xsl:element name="dd">
+                                        <xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
+                                            Maximum <xsl:value-of select="system_cache__dita:big_values_format(max(current-group()/number(text())))"/> 
+                                        </xsl:element>
+                                        <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__resolve__key">
+                                            <xsl:with-param name="fid" select="current-group()[ max(number(text()))]/@fid"/>
+                                        </xsl:call-template>
+                                    </xsl:element>
+                                    <xsl:element name="dd">
+                                        Średnia <xsl:value-of select="system_cache__dita:big_values_format(avg(current-group()/number(text())))"/> 
+                                    </xsl:element>
+                                    <xsl:element name="dd">
+                                        Suma <xsl:value-of select="system_cache__dita:big_values_format(sum(current-group()/number(text())))"/> 
+                                    </xsl:element>
+                                    <xsl:element name="dd">
+                                        Ilość <xsl:value-of select="count(current-group()/number(text()))"/> 
+                                    </xsl:element>
+                                </dlentry>
+                            </xsl:when>
+                            <xsl:otherwise>
+                                <dlentry>
+                                    <dt>
+                                        wykrycie danych 
+                                    </dt>
+                                    <dd>nieudane (brak wartości w zestawie danych)</dd>
+                                </dlentry>
+                                
+                            </xsl:otherwise>
+                        </xsl:choose>
+                        
+                        
+                    </xsl:when>
+                    <xsl:when test="string-length($p5gnuplot:value)=0">
+                        <xsl:comment>#155 going all </xsl:comment>
+                        
+                        <xsl:for-each-group select="stentry/p5gnuplot:stats" group-by="parent::*/@props">
+                            <dlentry>
+                                <dt>
+                                    min/max
+                                </dt>
+                                
+                            <xsl:element name="dd">
+                                Suma <xsl:value-of select="system_cache__dita:big_values_format(sum(current-group()/number(text())))"/> 
+                            </xsl:element>
+                            <xsl:element name="dd">
+                                Ilość <xsl:value-of select="count(current-group()/number(text()))"/> 
+                            </xsl:element>
+                            </dlentry>
+                            <dlentry>
+                                <xsl:call-template name="default_db__x3A__BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA:context.path.keyref__x3A__assign__id">
+                                    <xsl:with-param name="title">APU4_umowy</xsl:with-param>
+                                    <xsl:with-param name="graph.name">GAD_Linear_Regres</xsl:with-param>
+                                    <xsl:with-param name="system_cache__dita:element__x3A__name">dlentry</xsl:with-param>
+                                    <xsl:with-param name="fid" select="@fid"/>
+                                </xsl:call-template>
+                                <dt>
+                                    Analiza regresji liniowej dla całości zakresu
+                                </dt>
+                                    <dd>
+                                        
+                                        <xsl:variable name="Linear_regression:calculate_data">
+                                            <xsl:call-template name="Linear_regression:calculate_data">
+                                                <xsl:with-param name="Linear_regression:X_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingNumber</xsl:with-param>
+                                                <xsl:with-param name="Linear_regression:Y_attribute__x3A__set">default_db__x3A__BI_audit_BENFORD:leadingTimeYear-month</xsl:with-param>
+                                                <xsl:with-param name="Linear_regression:dataset" select="current-group()"/>
+                                            </xsl:call-template>
+                                        </xsl:variable>
+                                        <xsl:apply-templates mode="Linear_regression:calculate_data__x3A__to_dita" select="$Linear_regression:calculate_data"/>
+                                    </dd>
+                            </dlentry>
+                        </xsl:for-each-group>
+                        
+                        
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <!--<xsl:element name="{system_cache__dita:element.next($system_cache__dita:element__x3A__parent)}">
+                            Grupa nie z tego histogramu <xsl:value-of select="current-grouping-key()"/> fid <xsl:value-of select="@fid"/> col=<xsl:value-of select="@col"/> ;  <xsl:value-of select="$p5gnuplot:simpletable__x3A__from_rows.xsl.dita__x3A__detect__x3A__rowset.Y//varname[@props='system_cache__dita:graph.ytics_detect_row']/text()"/> ;
+                        </xsl:element>-->
+                        <xsl:comment>#139 Grupa nie z tego histogramu <xsl:value-of select="current-grouping-key()"/> fid <xsl:value-of select="@fid"/> col=<xsl:value-of select="parent::*/@col"/> ; $$p5gnuplot:value=<xsl:value-of select="$p5gnuplot:value"/></xsl:comment>
+                    </xsl:otherwise>
+                </xsl:choose>
+                
+            
+                
+                </xsl:for-each-group>
+            
+            
+            <!--</xsl:for-each-group>-->
+    </xsl:template>
+    
+    <xsl:template mode="p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze" match="text()|comment()"/>
+    
+    <xsl:template mode="p5gnuplot:simpletable__x3A__graph.stats__x3A__analyze" match="@*"/>
+    
+</xsl:stylesheet>