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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

record selection formula, please help

Status
Not open for further replies.

OT2

Technical User
Jan 14, 2005
54
US
Hello,
I am using CR9 and I am having problems selecting multiple values with the following selection formula:

If {?Portfolio} = "a" then
{mhfshdr.CodeName}=split("3498501,3498502,3498503,3498504,3498505,3498506,3498507,3498508,3498901,3498902,3844500,SICAVA,SOOVERSE,SOOVERVA,USVALUE,SOGLOBAL",",")
else
If {?Portfolio} = "b" then
{mhfshdr.CodeName}=split("3498720,3498840,3498850,3498804,3498803,3498802,3498750,3498722,3498660,3498645,3498640,3498450,3447000,1588904,1588903,0022594,3700460,1588901",",")
else
If {?Portfolio} = "c" then
{mhfshdr.CodeName}=split("3434230,3701600,3499300,3498500,3445100,0016010,3445104",",")
else
If {?Portfolio} = "d" then
{mhfshdr.CodeName}=split("3202035,3203531,3203561,3203570,3670001C,3680001,3202000",",")
else
If {?Portfolio} = "e" then
{mhfshdr.CodeName}=split("1588902,1588905,2602500,2690440,3501000",",")
else
If {?Portfolio} = "e" then
{mhfshdr.CodeName}=split("0016002,PEFUNDS,DEFFUNDS,0016040,0016035,0016010,0016000,0016030",",")
else
If {?Portfolio} = "g" then
{mhfshdr.CodeName}=split("3498602,3498606,3498605,3498603,3498607,3498601,3498604",",")

When I run this report and select multiple portfolios in my parameter I only get results for the last item I put into my parameter. For example, I select a,b,c and d I will only get back results for 9. Any suggestions?
ps: there are two other parameters in the report, trade start date and trade end date.

thank you,
 
Well you're using an if else...

Plus how could you get results for a 9???

The posting is interesting, consider posting requirements.

Example data
Expected output

-k
 
Try this:

If {?portfolio}="A" then {YourDatabaseField} in [list values here] else
If {?portfolio}="B" then {YourDatabaseField} in [list values here] else .......



Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
synaps that was a typo on my end, I dont get results for "9" I get back results for "c".

dgillz, thanks for your formula, but I am not getting any results when I use it, the report comes up blank. Any other way you recommend of getting this done? Maybe I am taking the wrong approach. How can I set up a parameter where a user can select one or multiple "groups" of portfolios?

any help is appreciated, thanks again
 
OK since its a multi value parameter, try this:

If "A" in {?portfolio} then [list values here] or
If "B" in {?portfolio} then [list values here] else .......


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top