<?xml version="1.0" encoding="utf-8"?>
<Dashboard>
  <Title Text="10-Karne" />
  <DataSources>
    <SqlDataSource Name="_Giza_Sirketler" ComponentName="sqlDataSource1">
      <Connection Name="RaporVeriKaynagi" FromAppConfig="true" />
      <Query Type="CustomSqlQuery" Name="_Giza_Karne">
        <Sql>SELECT ALACAKBAKIYE =
       (
           SELECT ISNULL(SUM(x.ALACAKBAKIYE), 0) AS ALACAKBAKIYE
           FROM
           (
               SELECT CAST(SUM(A.BORC - A.ALACAK) AS MONEY) AS ALACAKBAKIYE
               FROM TBLCAHAR A WITH (NOLOCK)
               --WHERE A.CARI_KOD LIKE '%120-%'
               GROUP BY A.CARI_KOD
               HAVING SUM(A.BORC - A.ALACAK) &gt; 1
           ) x
       ),
       BORCBAKIYE =
       (
           SELECT ISNULL(SUM(x.BORCBAKIYE), 0) AS BORCBAKIYE
           FROM
           (
               SELECT CAST(SUM(A.ALACAK - A.BORC) AS MONEY) AS BORCBAKIYE
               FROM TBLCAHAR A WITH (NOLOCK)
               --WHERE A.CARI_KOD LIKE '%320-%'
               GROUP BY A.CARI_KOD
               HAVING SUM(A.ALACAK - A.BORC) &gt; 1
           ) x
       ),
       BANKABAKIYE =
       (
           SELECT ISNULL(SUM(   (CASE BA
                                     WHEN 'B' THEN
                                         TUTAR
                                     ELSE
                                         0
                                 END
                                ) - (CASE BA
                                         WHEN 'A' THEN
                                             TUTAR
                                         ELSE
                                             0
                                     END
                                    )
                            ),
                         0
                        ) AS BANKABAKIYE
           FROM TBLBNKHESTRA
           --WHERE NETHESKODU LIKE '102-%'
       ),
       KASABAKIYE =
       (
           SELECT ISNULL(SUM(   (CASE IO
                                     WHEN 'G' THEN
                                         TUTAR
                                     ELSE
                                         0
                                 END
                                ) - (CASE IO
                                         WHEN 'C' THEN
                                             TUTAR
                                         ELSE
                                             0
                                     END
                                    )
                            ),
                         0
                        ) AS KASABAKIYE
           FROM TBLKASA
           --WHERE KSMAS_KOD IN ( 00 )
       );</Sql>
      </Query>
      <ConnectionOptions CloseConnection="true" />
      <CalculatedFields>
        <CalculatedField Name="BAKIYE" Expression="([ALACAKBAKIYE] + [BANKABAKIYE] + [KASABAKIYE]) - [BORCBAKIYE] " DataType="Auto" DataMember="_Giza_Karne" />
      </CalculatedFields>
    </SqlDataSource>
  </DataSources>
  <Items>
    <Card ComponentName="cardDashboardItem1" Name="Karne" DataSource="sqlDataSource1" DataMember="_Giza_Karne">
      <DataItems>
        <Measure DataMember="ALACAKBAKIYE" DefaultId="DataItem0">
          <NumericFormat FormatType="Number" Unit="Ones" IncludeGroupSeparator="true" />
        </Measure>
        <Measure DataMember="BANKABAKIYE" DefaultId="DataItem1">
          <NumericFormat FormatType="Number" Unit="Ones" IncludeGroupSeparator="true" />
        </Measure>
        <Measure DataMember="KASABAKIYE" DefaultId="DataItem2">
          <NumericFormat FormatType="Number" Unit="Ones" IncludeGroupSeparator="true" />
        </Measure>
        <Measure DataMember="BORCBAKIYE" DefaultId="DataItem5">
          <NumericFormat FormatType="Number" Unit="Ones" IncludeGroupSeparator="true" />
        </Measure>
      </DataItems>
      <Card Name="BORÇ">
        <ActualValue DefaultId="DataItem5" />
        <AbsoluteVariationNumericFormat />
        <PercentVariationNumericFormat />
        <PercentOfTargetNumericFormat />
        <LayoutTemplate MinWidth="100" Type="Lightweight">
          <MainValue Visible="true" ValueType="ActualValue" DimensionIndex="0" />
          <SubValue Visible="true" ValueType="Title" DimensionIndex="0" />
          <BottomValue Visible="true" ValueType="Subtitle" DimensionIndex="0" />
          <DeltaIndicator Visible="false" />
          <Sparkline Visible="false" />
        </LayoutTemplate>
      </Card>
      <Card Name="ALACAK">
        <ActualValue DefaultId="DataItem0" />
        <AbsoluteVariationNumericFormat />
        <PercentVariationNumericFormat />
        <PercentOfTargetNumericFormat />
        <LayoutTemplate MinWidth="100" Type="Lightweight">
          <MainValue Visible="true" ValueType="ActualValue" DimensionIndex="0" />
          <SubValue Visible="true" ValueType="Title" DimensionIndex="0" />
          <BottomValue Visible="true" ValueType="Subtitle" DimensionIndex="0" />
          <DeltaIndicator Visible="false" />
          <Sparkline Visible="false" />
        </LayoutTemplate>
      </Card>
      <Card Name="BANKA">
        <ActualValue DefaultId="DataItem1" />
        <AbsoluteVariationNumericFormat />
        <PercentVariationNumericFormat />
        <PercentOfTargetNumericFormat />
        <LayoutTemplate MinWidth="100" Type="Lightweight">
          <MainValue Visible="true" ValueType="ActualValue" DimensionIndex="0" />
          <SubValue Visible="true" ValueType="Title" DimensionIndex="0" />
          <BottomValue Visible="true" ValueType="Subtitle" DimensionIndex="0" />
          <DeltaIndicator Visible="false" />
          <Sparkline Visible="false" />
        </LayoutTemplate>
      </Card>
      <Card Name="KASA">
        <ActualValue DefaultId="DataItem2" />
        <AbsoluteVariationNumericFormat />
        <PercentVariationNumericFormat />
        <PercentOfTargetNumericFormat />
        <LayoutTemplate MinWidth="100" Type="Lightweight">
          <MainValue Visible="true" ValueType="ActualValue" DimensionIndex="0" />
          <SubValue Visible="true" ValueType="Title" DimensionIndex="0" />
          <BottomValue Visible="true" ValueType="Subtitle" DimensionIndex="0" />
          <DeltaIndicator Visible="false" />
          <Sparkline Visible="false" />
        </LayoutTemplate>
      </Card>
    </Card>
    <Card ComponentName="cardDashboardItem2" Name="BAKİYE" DataSource="sqlDataSource1" DataMember="_Giza_Karne">
      <DataItems>
        <Measure DataMember="BAKIYE" DefaultId="DataItem0">
          <NumericFormat FormatType="Number" Unit="Ones" IncludeGroupSeparator="true" />
        </Measure>
      </DataItems>
      <Card Name="BAKIYE">
        <ActualValue DefaultId="DataItem0" />
        <AbsoluteVariationNumericFormat />
        <PercentVariationNumericFormat />
        <PercentOfTargetNumericFormat />
        <LayoutTemplate MinWidth="270" MaxWidth="270" Type="Centered">
          <MainValue Visible="true" ValueType="Title" DimensionIndex="0" />
          <SubValue Visible="true" ValueType="Subtitle" DimensionIndex="0" />
          <BottomValue Visible="true" ValueType="ActualValue" DimensionIndex="0" />
          <BottomSubValue1 Visible="true" ValueType="AbsoluteVariation" DimensionIndex="0" />
          <BottomSubValue2 Visible="true" ValueType="PercentVariation" DimensionIndex="0" />
          <DeltaIndicator Visible="true" />
          <Sparkline Visible="true" />
        </LayoutTemplate>
      </Card>
    </Card>
  </Items>
  <LayoutTree>
    <LayoutGroup>
      <LayoutGroup Orientation="Vertical">
        <LayoutItem DashboardItem="cardDashboardItem2" />
        <LayoutItem DashboardItem="cardDashboardItem1" />
      </LayoutGroup>
    </LayoutGroup>
  </LayoutTree>
</Dashboard>