![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Are VBA (or any external) functions permitted as part of the lookupcube string? Example: using the Foodmart 2000 database, WITH MEMBER MEASURES.GOOD AS ' VBA!now() ' MEMBER MEASURES.BAD AS ' LookupCube("SALES", """not too bad""")' MEMBER MEASURES.UGLY AS ' LookupCube("SALES", "now()")' SELECT { GOOD, BAD, UGLY } ON 0 FROM HR returns an error --------------------------- Formula error - syntax error - token is not valid: " now^(^) " --------------------------- It gets stranger if the definition of UGLY is replaced by MEMBER MEASURES.UGLY AS 'cStr( LookupCube("SALES", "now()"))' Any help is greatly appreciated, I am particularly interested in using the isError function. -- addup -- |
#3
| |||
| |||
|
|
Did you try it with Format. Test samples below respectively. MEMBER MEASURES.UGLY AS 'Now()' MEMBER MEASURES.UGLY AS 'Format(Now(), "yyyymmdd")' MEMBER MEASURES.UGLY AS 'LookupCube("Sales", Format(Now(), "yyyymmdd"))' Ohjoo Kwon "addup" <adi.jog (AT) gmail (DOT) com> wrote in message news:1110321853.153222.151490 (AT) z14g2000cwz (DOT) googlegroups.com... Are VBA (or any external) functions permitted as part of the lookupcube string? Example: using the Foodmart 2000 database, WITH MEMBER MEASURES.GOOD AS ' VBA!now() ' MEMBER MEASURES.BAD AS ' LookupCube("SALES", """not too bad""")' MEMBER MEASURES.UGLY AS ' LookupCube("SALES", "now()")' SELECT { GOOD, BAD, UGLY } ON 0 FROM HR returns an error --------------------------- Formula error - syntax error - token is not valid: " now^(^) " --------------------------- It gets stranger if the definition of UGLY is replaced by MEMBER MEASURES.UGLY AS 'cStr( LookupCube("SALES", "now()"))' Any help is greatly appreciated, I am particularly interested in using the isError function. -- addup -- |
#4
| |||
| |||
|
|
Here's an example of a lookupcube function i used at our company. MEMBER [measures].[Top 25 Gross Adds] as ' sum ( [Top 25 Clients All Bill Types] , LookupCube ( "[Gross Adds]", "( [ADDS] , [Division Name].[Our Division], [prior start date].[" + Trim([Margin Time Name]) + "]" + ",[Client Name].["" + IIF(trim( left([client].currentmember.name, instr([client].currentmember.name,"[")-1)) = "CLIENT X", "CLIENT Y", trim( left([client].currentmember.name, instr([client].currentmember.name,"[")-1)) ) + "])" ) )' "Ohjoo Kwon" wrote: Did you try it with Format. Test samples below respectively. MEMBER MEASURES.UGLY AS 'Now()' MEMBER MEASURES.UGLY AS 'Format(Now(), "yyyymmdd")' MEMBER MEASURES.UGLY AS 'LookupCube("Sales", Format(Now(), "yyyymmdd"))' Ohjoo Kwon "addup" <adi.jog (AT) gmail (DOT) com> wrote in message news:1110321853.153222.151490 (AT) z14g2000cwz (DOT) googlegroups.com... Are VBA (or any external) functions permitted as part of the lookupcube string? Example: using the Foodmart 2000 database, WITH MEMBER MEASURES.GOOD AS ' VBA!now() ' MEMBER MEASURES.BAD AS ' LookupCube("SALES", """not too bad""")' MEMBER MEASURES.UGLY AS ' LookupCube("SALES", "now()")' SELECT { GOOD, BAD, UGLY } ON 0 FROM HR returns an error --------------------------- Formula error - syntax error - token is not valid: " now^(^) " --------------------------- It gets stranger if the definition of UGLY is replaced by MEMBER MEASURES.UGLY AS 'cStr( LookupCube("SALES", "now()"))' Any help is greatly appreciated, I am particularly interested in using the isError function. -- addup -- |
#5
| |||
| |||
|
|
Here's an example of a lookupcube function i used at our company. MEMBER [measures].[Top 25 Gross Adds] as ' sum ( [Top 25 Clients All Bill Types] , LookupCube ( "[Gross Adds]", "( [ADDS] , [Division Name].[Our Division], [prior start date].[" + Trim([Margin Time Name]) + "]" + ",[Client Name].["" + IIF(trim( left([client].currentmember.name, instr([client].currentmember.name,"[")-1)) = "CLIENT X", "CLIENT Y", trim( left([client].currentmember.name, instr([client].currentmember.name,"[")-1)) ) + "])" ) )' "Ohjoo Kwon" wrote: Did you try it with Format. Test samples below respectively. MEMBER MEASURES.UGLY AS 'Now()' MEMBER MEASURES.UGLY AS 'Format(Now(), "yyyymmdd")' MEMBER MEASURES.UGLY AS 'LookupCube("Sales", Format(Now(), "yyyymmdd"))' Ohjoo Kwon "addup" <adi.jog (AT) gmail (DOT) com> wrote in message news:1110321853.153222.151490 (AT) z14g2000cwz (DOT) googlegroups.com... Are VBA (or any external) functions permitted as part of the lookupcube string? Example: using the Foodmart 2000 database, WITH MEMBER MEASURES.GOOD AS ' VBA!now() ' MEMBER MEASURES.BAD AS ' LookupCube("SALES", """not too bad""")' MEMBER MEASURES.UGLY AS ' LookupCube("SALES", "now()")' SELECT { GOOD, BAD, UGLY } ON 0 FROM HR returns an error --------------------------- Formula error - syntax error - token is not valid: " now^(^) " --------------------------- It gets stranger if the definition of UGLY is replaced by MEMBER MEASURES.UGLY AS 'cStr( LookupCube("SALES", "now()"))' Any help is greatly appreciated, I am particularly interested in using the isError function. -- addup -- |
#6
| |||
| |||
|
#7
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |