InovacaoMediaBrasil/ProcessWorkflowsAndDatabaseScripts

View on GitHub
Src/Sankhya/Construtores de Componentes de BI/203.DONUT FATURAMENTO MARKETPLACE.xml

Summary

Maintainability
Test Coverage
<gadget>
    <prompt-parameters>
        <parameter id="DT1" description="Data de Inicio" metadata="date" required="true" keep-last="false" keep-date="false" order="0"/>
        <parameter id="DT2" description="Data Final" metadata="date" required="true" keep-last="false" keep-date="false" order="1"/>
        <parameter id="MARKET_ID" description="CNova" metadata="boolean" required="false" keep-last="false" keep-date="false" default="false" order="2"/>
        <parameter id="MARKET_ID1" description="B2W" metadata="boolean" required="false" keep-last="false" keep-date="false" default="false" order="3"/>
        <parameter id="MARKET_ID2" description="ShopFacil" metadata="boolean" required="false" keep-last="false" keep-date="false" default="false" order="4"/>
        <parameter id="MARKET_ID3" description="Walmart" metadata="boolean" required="false" keep-last="false" keep-date="false" default="false" order="5"/>
        <parameter id="MARKET_ID4" description="Mercado Livre" metadata="boolean" required="false" keep-last="false" keep-date="false" default="false" order="6"/>
    </prompt-parameters>
    <level id="lvl_a5zm4nz" description="Principal">
        <container orientacao="V" tamanhoRelativo="100">
            <chart id="cht_a5zm4n0" type="donut">
                <expression type="sql" data-source="MGEDS">
                    <![CDATA[SELECT VEN.APELIDO,   SUM(CAB.VLRNOTA) AS QTD_VENDAS  FROM sankhya.TGFCAB AS CAB WITH (NOLOCK)   JOIN SANKHYA.TGFVEN AS VEN WITH (NOLOCK) ON CAB.CODVEND = VEN.CODVEND WHERE  VEN.AD_CODAFILIADO IS NOT NULL   AND CAB.DTNEG BETWEEN :DT1 AND :DT2   AND CAB.CODTIPOPER = 502    AND CAB.CODVEND IN (CASE WHEN :MARKET_ID = 'S' THEN 224 ELSE '' END,           CASE WHEN :MARKET_ID1 = 'S' THEN 271 ELSE '' END,          CASE WHEN :MARKET_ID2 = 'S' THEN 250 ELSE '' END,          CASE WHEN :MARKET_ID3 = 'S' THEN 275 ELSE '' END,         CASE WHEN :MARKET_ID4 = 'S' THEN 263 ELSE '' END) GROUP BY VEN.APELIDO]]>
                </expression>
                <metadata>
                    <field name="APELIDO" label="Marketplace" type="S" visible="true" useFooter="false"/>
                    <field name="QTD_VENDAS" label="Faturamento" type="C" visible="true" useFooter="false" mask="R$ #.##0,00"/>
                </metadata>
                <series>
                    <serie type="donut">
                        <field>QTD_VENDAS</field>
                        <nameField>APELIDO</nameField>
                        <tipoDonut>completo</tipoDonut>
                    </serie>
                </series>
            </chart>
        </container>
    </level>
</gadget>