![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a calculated measure as follows called Effective Tax Rate. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt] I need to add filtering to the denominator. The pseudocode would look like this. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt where State (dimension) <> ''] Could someone help me out with the MDX syntax for this? |
#3
| |||
| |||
|
|
I didn't fully understand your questions, but, I think you mean to use a construct like this: IIF (<dimension>.CurrentMember <> 'something' AND [Merchandise Amt] <> 0, ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt], NULL) Murthy "ChrisBusch" wrote: I have a calculated measure as follows called Effective Tax Rate. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt] I need to add filtering to the denominator. The pseudocode would look like this. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt where State (dimension) <> ''] Could someone help me out with the MDX syntax for this? |
#4
| |||
| |||
|
|
Close, but getting a syntax error. The test is State = ' ' I get invalid token on this... IIF (State.CurrentMember = ' ' AND [Merchandise Amt] <> 0, ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt], NULL) "MurthyJ" wrote: I didn't fully understand your questions, but, I think you mean to use a construct like this: IIF (<dimension>.CurrentMember <> 'something' AND [Merchandise Amt] <> 0, ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt], NULL) Murthy "ChrisBusch" wrote: I have a calculated measure as follows called Effective Tax Rate. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt] I need to add filtering to the denominator. The pseudocode would look like this. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt where State (dimension) <> ''] Could someone help me out with the MDX syntax for this? |
#5
| |||
| |||
|
|
You can try one of these forms to see which one fits what you need: State.CurrentMember.UniqueName= "" (notice double quotes, not single quotes) State.CurrentMember IS NULL Murthy "CBUSCH" wrote: Close, but getting a syntax error. The test is State = ' ' I get invalid token on this... IIF (State.CurrentMember = ' ' AND [Merchandise Amt] <> 0, ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt], NULL) "MurthyJ" wrote: I didn't fully understand your questions, but, I think you mean to use a construct like this: IIF (<dimension>.CurrentMember <> 'something' AND [Merchandise Amt] <> 0, ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt], NULL) Murthy "ChrisBusch" wrote: I have a calculated measure as follows called Effective Tax Rate. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt] I need to add filtering to the denominator. The pseudocode would look like this. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt where State (dimension) <> ''] Could someone help me out with the MDX syntax for this? |
#6
| |||
| |||
|
|
Got the syntax working, but the test on state is not working. I tried... IIF (State.CurrentMember.UniqueName= " ",[Merchandise Amt], NULL) and... IIF (State.CurrentMember.UniqueName= "",[Merchandise Amt], NULL) and... IIF (State.CurrentMember IS NULL,[Merchandise Amt], NULL) They all return Merchandise Amt regardless of what value is in State. I'm not sure what the value in State is blank, empty string, or nulll The value in the source database is blank (" ") Thanks for your help with this. "MurthyJ" wrote: You can try one of these forms to see which one fits what you need: State.CurrentMember.UniqueName= "" (notice double quotes, not single quotes) State.CurrentMember IS NULL Murthy "CBUSCH" wrote: Close, but getting a syntax error. The test is State = ' ' I get invalid token on this... IIF (State.CurrentMember = ' ' AND [Merchandise Amt] <> 0, ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt], NULL) "MurthyJ" wrote: I didn't fully understand your questions, but, I think you mean to use a construct like this: IIF (<dimension>.CurrentMember <> 'something' AND [Merchandise Amt] <> 0, ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt], NULL) Murthy "ChrisBusch" wrote: I have a calculated measure as follows called Effective Tax Rate. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt] I need to add filtering to the denominator. The pseudocode would look like this. ([Tax Paid] + [Use tax Accrued]) / [Merchandise Amt where State (dimension) <> ''] Could someone help me out with the MDX syntax for this? |
![]() |
| Thread Tools | |
| Display Modes | |
| |