Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Christina Agyeman
Starting Member
15 Posts |
Posted - 2002-03-12 : 11:05:02
|
Can someone please explain why this formula does not work[Measures].[Work] * ( IIF(Time.currentmember.level.name="Month",[Time].currentmember.properties("Days In Month"),"")) |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-12 : 11:16:46
|
IIF() is an MS Access function. The corresponding SQL Server statement is CASE:[Measures].[Work] * CASE Time.currentmember.level.name WHEN 'Month' THEN [Time].currentmember.properties('Days In Month')ELSE '' END |
|
|
Arnold Fribble
Yak-finder General
1961 Posts |
Posted - 2002-03-12 : 12:09:08
|
Er, Rob, that's MDX, not SQL. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-12 : 12:30:57
|
Now, here's where I REALLY should be embarrassed: you cannot multiply a number by an empty string. You might need to try this:[Measures].[Work] * (IIF(Time.currentmember.level.name="Month",[Time].currentmember.properties("Days In Month"), 0))I don't know what the formula needs to calculate, but the expression will evaluate to zero if the IIF() statement is false. You'll need to change the zero to whatever is appropriate for your calculation. |
|
|
|
|
|