you shouldn't use Date field selection multiple times in your set modifier, since you set Date according your variable, remove the 'Date=, ' part in your set expressions.
If you need to know the day number of your max date within the month to calculate your average, you can also just use
If you want AVERAGE_STOCK = STOCK_AT_THE_END_OF_EACH_DAY / NO_OF_DAYS then you have two choises:
1. Create a separate time line (independent) and use it to calculate stock at the end of each day (heavy-duty calculation in interface when used, suited for a large number of transactions)
2. Calculate in script all the stocks at the end of each day in a separate table and read the values from it (suited for a smaller number of transactions)
i had calculated the average by using the following expression
rangesum(above(total Stock, 0, rowno(Total)))/count(distinct date)
the expression produce the average correctly, only when we use date field as a dimension.
If i remove date from dimension, the average calculates as i had told in the original discussion
i.e. average takes max.date stock and divide the no. of days selected
so again am stucked for a long while.
Please help me to solve the issue.
Thanks in Advance,