String operations to get it right
We have seen one example of doing string manipulation in a macro to swap the columns of slicer in Working with Dimensional Model chapter. In this recipe, I will show you more macro functions to manipulate the values and achieve the required functionality using them.
A report is required to show sales by date and product lines. This report should show data only for current month (full month).
Getting ready
Create a simple list report with Date, Product line, and sales Quantity as columns.
How to do it...
Open Query Explorer. Go to the query used by the list object.
Add a new detail filter and define it as:
[Date] between #timestampMask(_first_of_month($current_timestamp),'yyyy-mm-dd')# and #timestampMask(_last_of_month($current_timestamp),'yyyy-mm-dd')#
Run the report to test it. Unfortunately, the GO Sales database doesn't hold data for year 2010. However, if you insert rows for current month in the database, you will see that they are retrieved by the report...