![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I just want to find out whether a particular dimension say "Gender" is selected as a ROW or COLUMN dimension. I tried these two opions and got the same error. Unable to update the calculated member. Formula error - no set holder when referencing a named <set>. Sample 1: InStr(1, SetToStr(Axis(0)), "[Gender]." ) Sample 2: Iif(InStr(1, SetToStr(Axis(0)) ) , "[Gender].", "Selected", "Not Selected") Please help with the syntax, Thx Sam. |
#3
| |||
| |||
|
|
Hi Sam, You're trying to create this calc in Analysis Manager, aren't you? As you've probably found, the following works fine in MDX Sample App: WITH MEMBER MEASURES.TEST AS 'IIF(INSTR(1, SETTOSTR(AXIS(0)), "[Gender]."), "Y", "N")' SELECT {GENDER.MEMBERS} ON 0, [Marital Status].MEMBERS ON 1 FROM SALES WHERE(MEASURES.TEST) ...but you can't just cut and paste the same calc definition into Analysis Manager. This is, I think, because when you're creating a session scope calc (which is what you're doing in Analysis Manager) rather than a query scope calc, the AXIS(N) sets don't exist so the definition is invalid. You can get round this quite easily though with a bit of late-binding; try using the following definition: IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Y", "N") HTH, Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Prasad" wrote: Hi, I just want to find out whether a particular dimension say "Gender" is selected as a ROW or COLUMN dimension. I tried these two opions and got the same error. Unable to update the calculated member. Formula error - no set holder when referencing a named <set>. Sample 1: InStr(1, SetToStr(Axis(0)), "[Gender]." ) Sample 2: Iif(InStr(1, SetToStr(Axis(0)) ) , "[Gender].", "Selected", "Not Selected") Please help with the syntax, Thx Sam. |
#4
| |||
| |||
|
|
Hi Chris, Thanks for the reply. The solution you gave works nicely with 32 bit Analysis Server. But the issue is we are going into production with 64-bit Analysis Server and it looks like the 64 bit does not support VBA functions. Please suggest an alternative for functions like the "Instr" in the below formula. IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Y", "N") Everything else is standared MDX functions. Thanks in advbance for your help, Sam. "Chris Webb" wrote: Hi Sam, You're trying to create this calc in Analysis Manager, aren't you? As you've probably found, the following works fine in MDX Sample App: WITH MEMBER MEASURES.TEST AS 'IIF(INSTR(1, SETTOSTR(AXIS(0)), "[Gender]."), "Y", "N")' SELECT {GENDER.MEMBERS} ON 0, [Marital Status].MEMBERS ON 1 FROM SALES WHERE(MEASURES.TEST) ...but you can't just cut and paste the same calc definition into Analysis Manager. This is, I think, because when you're creating a session scope calc (which is what you're doing in Analysis Manager) rather than a query scope calc, the AXIS(N) sets don't exist so the definition is invalid. You can get round this quite easily though with a bit of late-binding; try using the following definition: IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Y", "N") HTH, Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Prasad" wrote: Hi, I just want to find out whether a particular dimension say "Gender" is selected as a ROW or COLUMN dimension. I tried these two opions and got the same error. Unable to update the calculated member. Formula error - no set holder when referencing a named <set>. Sample 1: InStr(1, SetToStr(Axis(0)), "[Gender]." ) Sample 2: Iif(InStr(1, SetToStr(Axis(0)) ) , "[Gender].", "Selected", "Not Selected") Please help with the syntax, Thx Sam. |
#5
| |||
| |||
|
|
I'm fairly sure that the VBA library isn't supported on 64 bit. However I know that in SP4 a number of VBA functions are now supported natively in MDX (presumably for this very reason) - although I've not seen a definitive list so I don't know if INSTR is one of them. That said, I'm sure there will be a way of solving this problem without using VBA functions. When I've got access to an AS box on Monday I'll try to put together a solution and post it up here. Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Prasad" wrote: Hi Chris, Thanks for the reply. The solution you gave works nicely with 32 bit Analysis Server. But the issue is we are going into production with 64-bit Analysis Server and it looks like the 64 bit does not support VBA functions. Please suggest an alternative for functions like the "Instr" in the below formula. IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Y", "N") Everything else is standared MDX functions. Thanks in advbance for your help, Sam. "Chris Webb" wrote: Hi Sam, You're trying to create this calc in Analysis Manager, aren't you? As you've probably found, the following works fine in MDX Sample App: WITH MEMBER MEASURES.TEST AS 'IIF(INSTR(1, SETTOSTR(AXIS(0)), "[Gender]."), "Y", "N")' SELECT {GENDER.MEMBERS} ON 0, [Marital Status].MEMBERS ON 1 FROM SALES WHERE(MEASURES.TEST) ...but you can't just cut and paste the same calc definition into Analysis Manager. This is, I think, because when you're creating a session scope calc (which is what you're doing in Analysis Manager) rather than a query scope calc, the AXIS(N) sets don't exist so the definition is invalid. You can get round this quite easily though with a bit of late-binding; try using the following definition: IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Y", "N") HTH, Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Prasad" wrote: Hi, I just want to find out whether a particular dimension say "Gender" is selected as a ROW or COLUMN dimension. I tried these two opions and got the same error. Unable to update the calculated member. Formula error - no set holder when referencing a named <set>. Sample 1: InStr(1, SetToStr(Axis(0)), "[Gender]." ) Sample 2: Iif(InStr(1, SetToStr(Axis(0)) ) , "[Gender].", "Selected", "Not Selected") Please help with the syntax, Thx Sam. |
#6
| |||
| |||
|
|
Well, I've got a solution: WITH MEMBER MEASURES.TEST AS 'NULL' CELL CALCULATION DEMO FOR '({MEASURES.[TEST]})' AS ' AXIS(0).ITEM(0).ITEM(129-CALCULATIONCURRENTPASS()).DIMENSION IS [GENDER] OR CALCULATIONPASSVALUE(MEASURES.TEST, -1, RELATIVE) ', CALCULATION_PASS_NUMBER=129, CALCULATION_PASS_DEPTH=128, SOLVE_ORDER=2, CONDITION='CALCULATIONCURRENTPASS()>(129-AXIS(0).ITEM(0).COUNT)' SELECT CROSSJOIN([Customers].[(All)].MEMBERS,[Gender].MEMBERS) ON 0, {MEASURES.TEST} ON 1 FROM SALES Measures.Test returns 1 if Gender is on columns, and 0 if it isn't. It relies on using calculated cells to perform an iteration over all the members present in the first tuple in the AXIS(0) set. Not pleasant, but it's the only way I can think of to do it without using any VBA functions... HTH, Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Chris Webb" wrote: I'm fairly sure that the VBA library isn't supported on 64 bit. However I know that in SP4 a number of VBA functions are now supported natively in MDX (presumably for this very reason) - although I've not seen a definitive list so I don't know if INSTR is one of them. That said, I'm sure there will be a way of solving this problem without using VBA functions. When I've got access to an AS box on Monday I'll try to put together a solution and post it up here. Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Prasad" wrote: Hi Chris, Thanks for the reply. The solution you gave works nicely with 32 bit Analysis Server. But the issue is we are going into production with 64-bit Analysis Server and it looks like the 64 bit does not support VBA functions. Please suggest an alternative for functions like the "Instr" in the below formula. IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Y", "N") Everything else is standared MDX functions. Thanks in advbance for your help, Sam. "Chris Webb" wrote: Hi Sam, You're trying to create this calc in Analysis Manager, aren't you? As you've probably found, the following works fine in MDX Sample App: WITH MEMBER MEASURES.TEST AS 'IIF(INSTR(1, SETTOSTR(AXIS(0)), "[Gender]."), "Y", "N")' SELECT {GENDER.MEMBERS} ON 0, [Marital Status].MEMBERS ON 1 FROM SALES WHERE(MEASURES.TEST) ...but you can't just cut and paste the same calc definition into Analysis Manager. This is, I think, because when you're creating a session scope calc (which is what you're doing in Analysis Manager) rather than a query scope calc, the AXIS(N) sets don't exist so the definition is invalid. You can get round this quite easily though with a bit of late-binding; try using the following definition: IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Y", "N") HTH, Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Prasad" wrote: Hi, I just want to find out whether a particular dimension say "Gender" is selected as a ROW or COLUMN dimension. I tried these two opions and got the same error. Unable to update the calculated member. Formula error - no set holder when referencing a named <set>. Sample 1: InStr(1, SetToStr(Axis(0)), "[Gender]." ) Sample 2: Iif(InStr(1, SetToStr(Axis(0)) ) , "[Gender].", "Selected", "Not Selected") Please help with the syntax, Thx Sam. |
#7
| |||
| |||
|
|
Hi Chris, Thx again for the reply. I learn that we can write UDF's in C++ and compile them using the 64-bit SDK. I am not sure what the server (computer) needs in terms of software to compile the code written in C++ as i am not a C++ developer. Do you have any idea of doing this? It will be nice if you can refer me to some samples & documentation on this. Thanks, Sam "Chris Webb" wrote: Well, I've got a solution: WITH MEMBER MEASURES.TEST AS 'NULL' CELL CALCULATION DEMO FOR '({MEASURES.[TEST]})' AS ' AXIS(0).ITEM(0).ITEM(129-CALCULATIONCURRENTPASS()).DIMENSION IS [GENDER] OR CALCULATIONPASSVALUE(MEASURES.TEST, -1, RELATIVE) ', CALCULATION_PASS_NUMBER=129, CALCULATION_PASS_DEPTH=128, SOLVE_ORDER=2, CONDITION='CALCULATIONCURRENTPASS()>(129-AXIS(0).ITEM(0).COUNT)' SELECT CROSSJOIN([Customers].[(All)].MEMBERS,[Gender].MEMBERS) ON 0, {MEASURES.TEST} ON 1 FROM SALES Measures.Test returns 1 if Gender is on columns, and 0 if it isn't. It relies on using calculated cells to perform an iteration over all the members present in the first tuple in the AXIS(0) set. Not pleasant, but it's the only way I can think of to do it without using any VBA functions... HTH, Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Chris Webb" wrote: I'm fairly sure that the VBA library isn't supported on 64 bit. However I know that in SP4 a number of VBA functions are now supported natively in MDX (presumably for this very reason) - although I've not seen a definitive list so I don't know if INSTR is one of them. That said, I'm sure there will be a way of solving this problem without using VBA functions. When I've got access to an AS box on Monday I'll try to put together a solution and post it up here. Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Prasad" wrote: Hi Chris, Thanks for the reply. The solution you gave works nicely with 32 bit Analysis Server. But the issue is we are going into production with 64-bit Analysis Server and it looks like the 64 bit does not support VBA functions. Please suggest an alternative for functions like the "Instr" in the below formula. IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Y", "N") Everything else is standared MDX functions. Thanks in advbance for your help, Sam. "Chris Webb" wrote: Hi Sam, You're trying to create this calc in Analysis Manager, aren't you? As you've probably found, the following works fine in MDX Sample App: WITH MEMBER MEASURES.TEST AS 'IIF(INSTR(1, SETTOSTR(AXIS(0)), "[Gender]."), "Y", "N")' SELECT {GENDER.MEMBERS} ON 0, [Marital Status].MEMBERS ON 1 FROM SALES WHERE(MEASURES.TEST) ...but you can't just cut and paste the same calc definition into Analysis Manager. This is, I think, because when you're creating a session scope calc (which is what you're doing in Analysis Manager) rather than a query scope calc, the AXIS(N) sets don't exist so the definition is invalid. You can get round this quite easily though with a bit of late-binding; try using the following definition: IIF(INSTR(1, SETTOSTR(STRTOSET("AXIS(0)")), "[Gender]."), "Y", "N") HTH, Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "Prasad" wrote: Hi, I just want to find out whether a particular dimension say "Gender" is selected as a ROW or COLUMN dimension. I tried these two opions and got the same error. Unable to update the calculated member. Formula error - no set holder when referencing a named <set>. Sample 1: InStr(1, SetToStr(Axis(0)), "[Gender]." ) Sample 2: Iif(InStr(1, SetToStr(Axis(0)) ) , "[Gender].", "Selected", "Not Selected") Please help with the syntax, Thx Sam. |
![]() |
| Thread Tools | |
| Display Modes | |
| |