Hello Experts.
I want to join/merge sales and payment data. But, my summarization data is giving me duplicate sales amount. I dont want that
Datasets are below:
data payment; infile cards dlm=',' dsd; input ticketid :$20. Promo_Type Payment_Type :$12. customer_id :$15. OrderDate :yymmdd10. Promo_Des :$30. Payment_Amt; format OrderDate yymmdd10.; cards; A098765,,credit,C014532,2021-05-11,,500 A098765,,cash,C014532,2021-05-11,,100 A098765,,cash,C014532,2021-05-11,,180 A098765,,check,C014532,2021-05-11,,200 A098765,8360,Finance,C014532,2021-05-11,"36 months",5000 A098765,8600,Finance,C014532,2021-05-11,"60 months",3500 ; run;
data Sales; infile cards dlm=',' dsd; input ticketid :$20. ProductId :$20. customer_id :$15. OrderDate :yymmdd10. Sales_amt; format OrderDate yymmdd10.; cards; A098765,"AX-14589",C014532,2021-05-11,1570 ; run;
I want my output like this
Assume Two filters are there.
1.Payment_Type
2.Promo_Type
Orderdate
sum of sales_amt
sum of payment_amt
11-05-2021
1570
9480
If i select select Payment_type as Cash means my output need to be
Orderdate
sum of sales_amt
sum of payment_amt
11-05-2021
0
280
If i select Promo_Type as 8360 means my output need to be
Orderdate
sum of sales_amt
sum of payment_amt
11-05-2021
0
5000
Can some one help me on this?
Thanks in Advance
... View more