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.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 IF function based on 2 columns

Author  Topic 

Toine0109
Starting Member

1 Post

Posted - 2010-04-08 : 15:22:41
Hi,

THE SETTING:
I'm trying to develop a tool that automatically analyses survey-results, conducted in companies on a department level.
I have a table with 2 columns. One column which holds the "happyness score" for the selected department (via parameter) and another column which holds this same score but on a company wide level. This happyness is based on 7 factors, so each factor has a row/score.
The underlying dataset has a column for SatisfactionDepartment and SatisfactionTotal per Factor (which is also a column).

THE PROBLEM:
This data also has to display in a bar graph, but the minimum and maximum value of the axis has to be based on the obtained values. The minimum or maximum has to be an integer. So I need an expression that gives me the integer lower than the overall lowest occurring "happyness score" to set as minimum.

THE ATTEMPT:
=iif(
min(Fields!SatisfactionDpt.Value)>min(Fields!SatisfactionTot.Value),
floor(((min(Fields!SatisfactionTot)-Avg(Fields!SatisfactionTot.Value))/StDev(Fields!SatisfactionTot.Value))*Stdev(Fields!SatisfactionTot.Value)),
floor(((min(Fields!SatisfactionDpt)-Avg(Fields!SatisfactionTot.Value))/StDev(Fields!SatisfactionTot.Value))*Stdev(Fields!SatisfactionTot.Value))
)

Hope someone can help, thx in advance!
   

- Advertisement -