expression=sum(HeadCount) should show the information for last month
I have historic data of headcount, i.e. headcounts for each department for each month in the last two years,
I have limited my data to the most current one by selecting a value in a field that specified the month the data was created. For example, I have ReportMonth that holds that information, just select 2014-June and a chart with dimension Department and expression=sum(HeadCount) should show the latest information.
But my problem is that this ReportMonth field is fixed in my script, and now I need to show expression =sum(HeadCount) for any Month which the user select and sumarizing just the selected month data.
Re: expression=sum(HeadCount) should show the information for last month
Sounds like a perfect case for set analysis...
Create a calendar table and then a variable called 'vReportMonthSelected'. Set this variable to be the report month selected by the user eg. = only(getfieldselections(ReportMonth)), then use an expression like: