sounds interesting but can you please specify your problem?
I understand your customer selects a month.... means a month and year or just a month? And how shall the "last 15 days" be understood? 15.-30st of the month?
Last 15 days back from any given day would be something I understand but that sounds strange to me.
sounds like a typical set analysis:
once month and year are seleted, by max(yourDATEfield) you should get the last available day of the month.
Then in set analysis do something like
The date function in the set analysis ensures that the formatting of the "-15" result is a date, not a number.
Not sure if there might occur an issue if the last day of the month is >15th so the resilt of "-15" goes back to the last month. But actually the month selection should ensure that in that case only the values of the choosen month are averaged.
Try to store the Selections in a variable, for ex. v_sel=GetFieldSelections(Dim_Month)&' '&GetFieldSelections(Dim_Year). Let's say if he selects Apr & 2016 respectively.
The variable would store value 'Apr 2016'
Now, for getting the sum of Sales for last 15 days for the month of April 2016, you can use the following set analysis:
You can modify the date format based on your selections.