
select BusinessDay,
		DATENAME(WEEKDAY, BusinessDay), 
 -- Carry Out    
  
  SUM(CASE ts.InOutDel WHEN 0 THEN Sales_Excl_GST_Excl ELSE 0 END) AS CarryOutAmount,    
  
  SUM(CASE ts.InOutDel WHEN 0 THEN TransactionCount ELSE 0 END) AS CarryOutCount,    
  
    
  
  -- PickUp    
  
  SUM(CASE WHEN ts.InOutDel = 1 OR ts.InOutDel = 6 THEN Sales_Excl_GST_Excl ELSE 0 END) AS PickUpAmount,    
  
  SUM(CASE WHEN ts.InOutDel = 1 OR ts.InOutDel = 6 THEN TransactionCount ELSE 0 END) AS PickUpCount,    
  
    
  
  -- Delivery    
  
  SUM(CASE WHEN ts.InOutDel = 2 OR ts.InOutDel = 7 THEN Sales_Excl_GST_Excl ELSE 0 END) AS DeliveryAmount,    
  
  SUM(CASE WHEN ts.InOutDel = 2 OR ts.InOutDel = 7 THEN TransactionCount ELSE 0 END) AS DeliveryCount,    
  
    
  
  -- Eat In    
  
  SUM(CASE ts.InOutDel WHEN 3 THEN Sales_Excl_GST_Excl ELSE 0 END) AS EatInAmount,    
  
  SUM(CASE ts.InOutDel WHEN 3 THEN TransactionCount ELSE 0 END) AS EatInCount,    
  
      
  
  -- Drive Thru    
  
  SUM(CASE ts.InOutDel WHEN 4 THEN Sales_Excl_GST_Excl ELSE 0 END) AS DriveThruAmount,    
  
  SUM(CASE ts.InOutDel WHEN 4 THEN TransactionCount ELSE 0 END) AS DriveThruCount,    
  
    
  
  -- Catering    
  
  SUM(CASE ts.InOutDel WHEN 5 THEN Sales_Excl_GST_Excl ELSE 0 END) AS CateringAmount,    
  
  SUM(CASE ts.InOutDel WHEN 5 THEN TransactionCount ELSE 0 END) AS CateringCount,    
  
    
  
  -- Full Service    
  
  SUM(CASE ts.InOutDel WHEN 12 THEN Sales_Excl_GST_Excl ELSE 0 END) AS FullServiceAmount,    
  
  SUM(CASE ts.InOutDel WHEN 12 THEN TransactionCount ELSE 0 END) AS FullServiceCount
FROM tbTransactionSummary ts with (nolock)
where EntityID = 1810
and DATENAME(WEEKDAY,BusinessDay) in ('Tuesday','Thursday')
and BusinessDay >= '2020-09-01'

group by BusinessDay

order by BusinessDay