Hi Páll,
I have come up with a "somewhat" solution - not the best, I admit, but maybe it can inspire others to try and make it better.
The problem is that it goes into "Undefined" state when doing a range calculation on a dimension member that does not exist. My solution is to do an up front check to see if we will hit a undefined state, and if positive, then avoid the range calculation on the undefined state.
The downside is that it will only be able to show the correct days-of-month number for one month at a time. I.e. when you select just one month from the criteria bar, then this month month will show the correct number - if you have multiple months, only the first month will show the correct number (the others will zero).
if sum(@"[Jan]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Jan]", d1, m1) then 31 else 0) else
if sum(@"[Feb]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Feb]", d1, m1) then 28 else 0) else
if sum(@"[Mar]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Mar]", d1, m1) then 31 else 0) else
if sum(@"[Apr]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Apr]", d1, m1) then 30 else 0) else
if sum(@"[May]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[May]", d1, m1) then 31 else 0) else
if sum(@"[Jun]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Jun]", d1, m1) then 30 else 0) else
if sum(@"[Jul]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Jul]", d1, m1) then 31 else 0) else
if sum(@"[Aug]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Aug]", d1, m1) then 31 else 0) else
if sum(@"[Sep]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Sep]", d1, m1) then 30 else 0) else
if sum(@"[Oct]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Oct]", d1, m1) then 31 else 0) else
if sum(@"[Nov]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Nov]", d1, m1) then 30 else 0) else
if sum(@"[Dec]", 0, m1, 999) <> 999 then (if allcount(d1:0, d1, m1) = allcount(d1:@"[Dec]", d1, m1) then 31 else 0) else 0
Best regards,
Ole
Edited by user Friday, May 31, 2013 3:30:36 PM(UTC)
| Reason: Not specified