title: customer count where transactions are not null
body: <pre><code> with hrk as (
      select a.LBrCode,a.VcrAcctId,a.DrCr,a.FcyTrnAmt amt,
  b.CustNo,b.AcctType,c.AMLRating x 
      from vcr a 
      inner join ac_mast b on a.LBrCode=b.LBrCode and substring(a.VcrAcctId,1,24)=substring(b.PrdAcctId,1,24)
      left join cust_mast c on b.CustNo=c.CustNo
      where a.entrydate  between '01-jan-2021' and '31-mar-2021'
  )
  select AcctType,
   count(*) over() cust_cnt,
  sum(case when (DrCr='C' and x=1)then amt else 0 end) low_credit,
  sum(case when (DrCr='C' and x=1)then 1 else 0 end)   low_credit_cnt,
  sum(case when (DrCr='D' and x=1)then amt else 0 end) low_debit,
  sum(case when (DrCr='D' and x=1)then 1 else 0 end)   low_debit_cnt,
                                 
  sum(case when (DrCr='C' and x=2)then amt else 0 end) Medium_credit,
  sum(case when (DrCr='C' and x=2)then 1 else 0 end)   Medium_credit_cnt,
  sum(case when (DrCr='D' and x=2)then amt else 0 end) Medium_debit,
  sum(case when (DrCr='D' and x=2)then 1 else 0 end)   Medium_debit_cnt,
                                 
  sum(case when (DrCr='C' and x=2)then amt else 0 end) high_credit,
  sum(case when (DrCr='C' and x=2)then 1 else 0 end)   high_credit_cnt,
  sum(case when (DrCr='D' and x=2)then amt else 0 end) high_debit,
  sum(case when (DrCr='D' and x=2)then 1 else 0 end)   high_debit_cnt
  from hrk
  group by AcctType
  </code></pre>
  <p>-- There can be N no of transactions for a given custNo and there can be multiple custono under AMLRating
  I want No of Custno involved in each category namely low,medium,high where sum is not null</p>