![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I need to create a calculated measure of type string, based on a dimension level property. But I can't find a way to avoid having empty values of the calculated measure show up. Our client is Excel. I've put together an example of this using FOODMART so others can see the problem better. In the Sales cube, I create a calculated measure called "Store Manager". Its formula is: iif([Store].CurrentMember.Level.Name="Store Name", iif([Store].CurrentMember.Properties("Store Manager")="", "EMPTY", [Store].CurrentMember.Properties("Store Manager") ), "NOTTHISLEVEL" ) This works, and in Excel, it displays "EMPTY" for Store=USA.CA.Alameda.HQ, which is the only store that has an empty string for the Store Manager's name. But what I really want is for the calculated measure to return NULL so the Alameda HQ store or any others without an assigned manager simply don't show up. But if I change the formula like this: iif([Store].CurrentMember.Level.Name="Store Name", iif([Store].CurrentMember.Properties("Store Manager")="", NULL, [Store].CurrentMember.Properties("Store Manager") ), NULL ) I get the error message: Unable to update the calculated member. Formula error - syntax error - token is not valid: " ^)^, NULL )" I have also tried creating a measure with the value NULL and making reference to it in place of "NULL", but MSAS treats it just as if it were the value NULL and gives me the same error. Our client is Excel, so there is no possibility of filtering on known values. As far as I know, this must happen in the calculated measure. Help! This seemingly simple problem is turning into a showstopper on our project. Thanks in advance. |
#3
| |||
| |||
|
|
I need to create a calculated measure of type string, based on a dimension level property. But I can't find a way to avoid having empty values of the calculated measure show up. Our client is Excel. I've put together an example of this using FOODMART so others can see the problem better. In the Sales cube, I create a calculated measure called "Store Manager". Its formula is: iif([Store].CurrentMember.Level.Name="Store Name", iif([Store].CurrentMember.Properties("Store Manager")="", "EMPTY", [Store].CurrentMember.Properties("Store Manager") ), "NOTTHISLEVEL" ) This works, and in Excel, it displays "EMPTY" for Store=USA.CA.Alameda.HQ, which is the only store that has an empty string for the Store Manager's name. But what I really want is for the calculated measure to return NULL so the Alameda HQ store or any others without an assigned manager simply don't show up. But if I change the formula like this: iif([Store].CurrentMember.Level.Name="Store Name", iif([Store].CurrentMember.Properties("Store Manager")="", NULL, [Store].CurrentMember.Properties("Store Manager") ), NULL ) I get the error message: Unable to update the calculated member. Formula error - syntax error - token is not valid: " ^)^, NULL )" I have also tried creating a measure with the value NULL and making reference to it in place of "NULL", but MSAS treats it just as if it were the value NULL and gives me the same error. Our client is Excel, so there is no possibility of filtering on known values. As far as I know, this must happen in the calculated measure. Help! This seemingly simple problem is turning into a showstopper on our project. Thanks in advance. |
#4
| |||
| |||
|
|
Apparently the following can't be used as a calculated measure in MSAS: iif(some_string_value = "", NULL, some_string_value ) I consider this a bug. Can someone explain to me why it must be this way (I know, you can't do analysis on strings, but my clients always want this). |
![]() |
| Thread Tools | |
| Display Modes | |
| |