Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Another Case Stmt Problem


Rook2Q5
 Share

Recommended Posts

This statement is NOT returning correct text field result when I plug in the numbers greater than 4 and less than 40 (in multiples of 4 only, e.g., 4, 8, 12....). I either get "Pass" or an empty field result.

 

testPassFail code=

Case

(

testCategory = "Reading Comp" and testScore ≥ "4" and testScore ≤ "71"; TextColor("Fail"; RGB(128; 0; 0));

testCategory = "Reading Comp" and testScore ≥ "72" and testScore ≤ "100"; "Pass"

)

 

I've gone as far as to replace the Reading Comp testscore field with a different metrics field called nbrCorrect (a number field):

 

testPassFail code =

Case

(

testCategory = "Reading Comp" and nbrCorrect ≥ "1" and nbrCorrect ≤ "17"; TextColor("Fail"; RGB(128; 0; 0));

testCategory = "Reading Comp" and nbrCorrect ≥ "18" and nbrCorrect ≤ "25"; "Pass";

)

 

nbrCorrect code:

Case

(

testCategory = "Reading Comp";

Case

(

testScore = 4; 1;

testScore = 8; 2; testScore = 12; 3; testScore = 16; 4; testScore = 20; 5;

testScore = 24; 6; testScore = 28; 7; testScore = 32; 8; testScore = 36; 9;

testScore = 40; 10; testScore = 44; 11; testScore = 48; 12; testScore = 52; 13;

testScore = 56; 14; testScore = 60; 15; testScore = 64; 16; testScore = 68; 17;

testScore = 72; 18; testScore = 76; 19; testScore = 80; 20; testScore = 84; 21;

testScore = 88; 22; testScore = 92; 23; testScore = 96; 24; testScore = 100; 25

))

 

BTW, I've tried various "Getas" (number, data, text) scenarios, but all have failed to return the proper "Fail" or "Pass" when needed! Please let me know where I've gone wrong in both sample Cases.

 

Thanks for you help.

 

Rook

Link to comment
Share on other sites

a) make sure testScore is a Number field (or a calculation field of result type "number").

 

b) get rid of the quotation marks around the numbers like so:

 

Case

(

testCategory = "Reading Comp" and testScore ≥ 4 and testScore ≤ 71; TextColor("Fail"; RGB(128; 0; 0));

testCategory = "Reading Comp" and testScore ≥ 72 and testScore ≤ 100; "Pass"

)

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use