USE OLAP
--Filtering by Multiple Columns Using Named Parameter Passing
go
CREATE PROCEDURE call_profit_by_order_method_type_filtered
	@date varchar(120) = '%'
	,@city char(129) = '%'
	,@retailer_type char(120) = '%'
AS
BEGIN
	SELECT * 
	FROM profit_by_order_method_type_filtered(@date, @city, @retailer_type)
END
go

--Now we can pass the values using the name of the column we want to filter on.
exec call_profit_by_order_method_type_filtered @date='2016-01-01'
exec call_profit_by_order_method_type_filtered @city = 'Sydney'
exec call_profit_by_order_method_type_filtered @retailer_type = 'Sports Store'
exec call_profit_by_order_method_type_filtered @date='2016-01-01', @retailer_type = 'Sports Store'
