Hi all,
I could not get out of a problem I have when trying to dynamically set a value depending on the month, compared to "CurrentMonth".
Here's the situation:
I was able to get the strings for
- the Month referenced by the palo.datac formula: using Palo.Ename and Palo.Eindex I can get e.g. 200903 as for March 2009
- the current month: using dateformat and NOW(), I can get 200904 as for April 2009
Now, it seems that using GE or GT to compare those strings does not work properly in my case, I don't know if it's a bug or I'm missing something. While the actual rule was more complicated, you find below an example to reproduce the behaviour in the Demo db:
1. in the Datatypes dimension, create the following members:
- Example (numeric)
- PaloEname (string)
- DateFormat (string)
The second and third are only for check purposes, see below
2. In the Sales cube, add this rules:
['Example'] = IF(ge(PALO.ENAME("Demo","Years",PALO.EINDEX ("Demo","Years",!'Years')),DATEFORMAT(NOW(),"\Y")),['Budget'],['Actual'])
the above is the important rue, the following ones are for check
['PaloEname'] = PALO.ENAME("Demo","Years",PALO.EINDEX ("Demo","Years",!'Years'))
['DateFormat'] = DATEFORMAT(NOW(),"\Y")
So, according to first rule, I should get Budget if the month is in the future, and Actual if it is in the past, but now paste a view like the attached one (I manually entered values in Actual and Budget since my db was empty): you can see that, while the members PaloEname e DateFormat are properly filled, "Example" always get the same value (Actual). Practically the second element in the comparison is always evaluated greater than the first.
I also tried to compare using value(..) instead of comparing the strings but it worked even worse.
Any suggestion?
Thanks in advance,
RQ