Ninad077 commited on
Commit
f9809c9
·
verified ·
1 Parent(s): 6a7a08e

Update queries.py

Browse files
Files changed (1) hide show
  1. queries.py +16 -11
queries.py CHANGED
@@ -378,13 +378,13 @@ queries = {
378
  round(sum(claimable_amt)-total_utr_paid) as Diff
379
  from `fynd-db.finance_recon_tool_asia.Shipment_wise_Claim_UTR`
380
  where
381
- SF_UTR in ("_2414920231016000202198812",
382
  "_2414920231016000202197711",
383
  "_AXISCN0279665404",
384
  "_AXISCN0312196630",
385
  "_2414920231016000202198811")
386
- group by
387
- 1,2
388
  ''',
389
 
390
  # # Query 23
@@ -518,33 +518,38 @@ queries = {
518
  (select
519
  bag_id,
520
  transaction_type,
521
- concat(bag_id,transaction_type) as merged,
522
  count(concat(bag_id,transaction_type)) as bag_count
523
  from `fynd-db.finance_recon_tool_asia.Bag_Wise_Payout_Report`
524
  group by
525
  1,2,3)
526
-
527
- select
 
 
 
528
  A.bag_id,
529
  company_id,
530
  company_name,
531
  Payment_Date,
532
  A.transaction_type,
533
  UTR,
534
- concat(A.bag_id,A.transaction_type) as merged,
535
  bag_count,
536
  seller_net_collection,
537
  total_charges,
538
  Net_Payout
539
  from `fynd-db.finance_recon_tool_asia.Bag_Wise_Payout_Report` as A
540
  left join
541
- bag_count as B
542
  on
543
- concat(A.bag_id,A.transaction_type) = B.merged
544
  where
545
- bag_count <> 1
 
 
546
  group by
547
- 1,2,3,4,5,6,7,8,9,10,11
548
 
549
  ''',
550
 
 
378
  round(sum(claimable_amt)-total_utr_paid) as Diff
379
  from `fynd-db.finance_recon_tool_asia.Shipment_wise_Claim_UTR`
380
  where
381
+ SF_UTR in ("_2414920231016000202198812",
382
  "_2414920231016000202197711",
383
  "_AXISCN0279665404",
384
  "_AXISCN0312196630",
385
  "_2414920231016000202198811")
386
+ group by 1,2
387
+ having Diff <> 0
388
  ''',
389
 
390
  # # Query 23
 
518
  (select
519
  bag_id,
520
  transaction_type,
521
+ concat(bag_id,transaction_type,UTR) as merged,
522
  count(concat(bag_id,transaction_type)) as bag_count
523
  from `fynd-db.finance_recon_tool_asia.Bag_Wise_Payout_Report`
524
  group by
525
  1,2,3)
526
+
527
+ select
528
+ *
529
+ from
530
+ (select
531
  A.bag_id,
532
  company_id,
533
  company_name,
534
  Payment_Date,
535
  A.transaction_type,
536
  UTR,
537
+ concat(A.bag_id,A.transaction_type,UTR) as merged,
538
  bag_count,
539
  seller_net_collection,
540
  total_charges,
541
  Net_Payout
542
  from `fynd-db.finance_recon_tool_asia.Bag_Wise_Payout_Report` as A
543
  left join
544
+ bag_count as B
545
  on
546
+ concat(A.bag_id,A.transaction_type,UTR) = B.merged
547
  where
548
+ bag_count <> 1
549
+ )
550
+ where bag_id = 32841543
551
  group by
552
+ all
553
 
554
  ''',
555