Excel Reporting
 
Library Overview Reference Products Images Sales Stock Departments Formal Stocktake Restrictions Customer/Account Day Of Week Time Of Day Weather

Restrictions

Excel pinboards provide precise key metrics, such as total sales revenue yesterday. Often though you want to filter or restrict the data selected even further. Owing to how excel works it isnt possible to expand the number of arguments to each pinboard infinitely, so instead many pinboards allow you to add restrictions (typically in the 6th argument).

Restrictions are keyword based, and not all restrictions apply to all pinboards.

From a performance perspective, using restrictions may be faster or slower than without restrictions. The effect depends on the backend database engine, the exact restriction, and whether the resulting database query is more optimised or not for the database.

Explanation

Consider a list of sales

Sale#DateLocationCustomer IdTeller IdWeather
10011-Aug-2023 13:43212344Sunny
10021-Aug-2023 13:48244Sunny
10031-Aug-2023 14:12244Sunny
10041-Aug-2023 16:32244Sunny
10051-Aug-2023 19:07134568727Sunny
10062-Aug-2023 9:12212344Raining
10072-Aug-2023 9:1528144Raining

The pinboard

sales.count.period
returns the number of sales between two dates for a store location. So if we request this for both days, we get the answer of 7

=pinboard("sales.count.period", "1-aug-2023", "3-aug-2023")
However, if we want to restrict this to "cash sales" (those that don't have a known customer), then we add a restriction at the end
=pinboard("sales.count.period", "1-aug-2023", "3-aug-2023",,,,"cid=any")

And now the result is 4, being only those sales with a Customer Id

Multiple restrictions can be used. Here we request how many sales were made to customer 123 while the weather was raining ( result = 1 )

=pinboard("sales.count.period", "1-aug-2023", "3-aug-2023",,,,"cid=123 weather=raining")