Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Item Expession - IF THEN ELSE Statement

Status
Not open for further replies.

MissaLissa7

Programmer
Dec 10, 2012
2
US
I have a report which has a multi select prompt. I need to return the volume by individual and group for each department selected. I have it working if one department is selected, but if more then one department is selected then I get correct results for the first department in the IF THEN ELESE Statement and zero's for everything else.


Volume is a Member of the Account Summary hierarchy
Individual and Group are Members of the Client Type hierarchy
Selected Department is a data item which has expression referring to the Department Prompt Value - [zConsolidated Reporting].[Department].[Department]->?Department?
Policy Administration and Care Advocacy are Members of the Department hierarchy
Inforce Lives, Care Coordination, Care Coordination Flat Fee Units and Living Members are Members of the Account Summary hierarchy


Volume is a Data Item with the below expressions (a.k.a. 'My Headache'). The members Individual and Group are nested to the right of volume.


This works: Results are as expected
IF ([Selected Department]=[Policy Administration])
THEN ([Inforce Lives])
ELSE (0)

But if I add an ELSE IF it doesn't work: Results are as expected for Policy Administration but Zero's for Care Advocacy
IF ([Selected Department]=[Policy Administration])
THEN ([Inforce Lives])
ELSE IF([Selected Department]=[Care Advocacy])
THEN ([Care Coordination Hours]+[Care Coordination Flat Fee Units]+[Living Members])
ELSE (0)

What am I doing wrong?

Any help would be greatly appreciated.[smile2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top