Date Members in formulas
When I create a Date with a formula, using several functions, Pyramid seems to work fine:
When using common date functions with the created dates, everything looks correct to me:
Also, when doing calculations with those created dates:
However, when taking Members directly from a Date Dimension, things happen differently...
With common functions:
Making calculations:
So, it looks like it takes Date Members as null...
Any explanation? Maybe is there something to do on Model App?
Thank you.
1 reply
-
Hi Federico Riera ,
The key concept to understand here is that cube elements are not the same as values.
Now() and DateSerial() return date-values, and date functions (year/month) can be applied to them.
Members, however, represent selection-points within the cube. When selecting a member such as 2022-05-18 you are actually referring to a section within the cube and in this scope of your expression, you are getting the value of the default measure filtered down to the date 2022-05-18.
You can cast the Member's value into a date value, using the CDate function and member_value property. After casting the element into a date you can do use it in other functions:
Hope this clears things out,
Imbar