You need to sign in to do that
Don't have an account?
Ajay Kumar 261
Can this formula be optimized?
Hi,
Can anyone suggest me a better formula? This is working fine, however I wanted to see if I get a better formula as it is lengthy one.
CASE( MS_Score__c ,
"0",Profile_Score__c +MS_Score__c,
"1",Profile_Score__c +MS_Score__c,
"2",Profile_Score__c +MS_Score__c,
"3",Profile_Score__c +MS_Score__c,
"4",Profile_Score__c +MS_Score__c,
"A0",Profile_Score__c +RIGHT(MS_Score__c,1),
"A1",Profile_Score__c +RIGHT(MS_Score__c,1),
"A2",Profile_Score__c +RIGHT(MS_Score__c,1),
"A3",Profile_Score__c +RIGHT(MS_Score__c,1),
"A4",Profile_Score__c +RIGHT(MS_Score__c,1),
"B1",Profile_Score__c +RIGHT(MS_Score__c,1),
"B2",Profile_Score__c +RIGHT(MS_Score__c,1),
"B3",Profile_Score__c +RIGHT(MS_Score__c,1),
"B4",Profile_Score__c +RIGHT(MS_Score__c,1),
"C0",Profile_Score__c +RIGHT(MS_Score__c,1),
"C1",Profile_Score__c +RIGHT(MS_Score__c,1),
"C2",Profile_Score__c +RIGHT(MS_Score__c,1),
"C3",Profile_Score__c +RIGHT(MS_Score__c,1),
"C4",Profile_Score__c +RIGHT(MS_Score__c,1),
"D1",Profile_Score__c +RIGHT(MS_Score__c,1),
"D2",Profile_Score__c +RIGHT(MS_Score__c,1),
"D3",Profile_Score__c +RIGHT(MS_Score__c,1),
"D4",Profile_Score__c +RIGHT(MS_Score__c,1),
"E0",Profile_Score__c +RIGHT(MS_Score__c,1),
"E1",Profile_Score__c +RIGHT(MS_Score__c,1),
"E2",Profile_Score__c +RIGHT(MS_Score__c,1),
"E3",Profile_Score__c +RIGHT(MS_Score__c,1),
"E4",Profile_Score__c +RIGHT(MS_Score__c,1),
"U0",Profile_Score__c +RIGHT(MS_Score__c,1),
"U1",Profile_Score__c +RIGHT(MS_Score__c,1),
"U2",Profile_Score__c +RIGHT(MS_Score__c,1),
"U3",Profile_Score__c +RIGHT(MS_Score__c,1),
"U4",Profile_Score__c +RIGHT(MS_Score__c,1),
""
)
Regards,
Ajay
Can anyone suggest me a better formula? This is working fine, however I wanted to see if I get a better formula as it is lengthy one.
CASE( MS_Score__c ,
"0",Profile_Score__c +MS_Score__c,
"1",Profile_Score__c +MS_Score__c,
"2",Profile_Score__c +MS_Score__c,
"3",Profile_Score__c +MS_Score__c,
"4",Profile_Score__c +MS_Score__c,
"A0",Profile_Score__c +RIGHT(MS_Score__c,1),
"A1",Profile_Score__c +RIGHT(MS_Score__c,1),
"A2",Profile_Score__c +RIGHT(MS_Score__c,1),
"A3",Profile_Score__c +RIGHT(MS_Score__c,1),
"A4",Profile_Score__c +RIGHT(MS_Score__c,1),
"B1",Profile_Score__c +RIGHT(MS_Score__c,1),
"B2",Profile_Score__c +RIGHT(MS_Score__c,1),
"B3",Profile_Score__c +RIGHT(MS_Score__c,1),
"B4",Profile_Score__c +RIGHT(MS_Score__c,1),
"C0",Profile_Score__c +RIGHT(MS_Score__c,1),
"C1",Profile_Score__c +RIGHT(MS_Score__c,1),
"C2",Profile_Score__c +RIGHT(MS_Score__c,1),
"C3",Profile_Score__c +RIGHT(MS_Score__c,1),
"C4",Profile_Score__c +RIGHT(MS_Score__c,1),
"D1",Profile_Score__c +RIGHT(MS_Score__c,1),
"D2",Profile_Score__c +RIGHT(MS_Score__c,1),
"D3",Profile_Score__c +RIGHT(MS_Score__c,1),
"D4",Profile_Score__c +RIGHT(MS_Score__c,1),
"E0",Profile_Score__c +RIGHT(MS_Score__c,1),
"E1",Profile_Score__c +RIGHT(MS_Score__c,1),
"E2",Profile_Score__c +RIGHT(MS_Score__c,1),
"E3",Profile_Score__c +RIGHT(MS_Score__c,1),
"E4",Profile_Score__c +RIGHT(MS_Score__c,1),
"U0",Profile_Score__c +RIGHT(MS_Score__c,1),
"U1",Profile_Score__c +RIGHT(MS_Score__c,1),
"U2",Profile_Score__c +RIGHT(MS_Score__c,1),
"U3",Profile_Score__c +RIGHT(MS_Score__c,1),
"U4",Profile_Score__c +RIGHT(MS_Score__c,1),
""
)
Regards,
Ajay
Hi Ajay,
since it seems there is a pattern with your conditions, perhaps you could use 'LEN':
Fernand
All Answers
Hi Ajay,
since it seems there is a pattern with your conditions, perhaps you could use 'LEN':
Fernand
Case(Score_Merchant__c,
"A4",7,
"B4",7,
"C4",5,
"D4",4,
"A3",8,
"B3",7,
"C3",6,
"D3",5,
"A2",9,
"B2",8,
"C2",8,
"D2",8,
"A1",10,
"B1",9,
"C1",9,
"D1",8,
"A0",7,
"B0",6,
"C0",4,
"D0",3,
"E0",3,
"U0",4,
"E1",8,
"E2",8,
"E3",5,
"E4",4,
"U1",9,
"U2",8,
"U3",6,
"U4",5,
0)
I can't really see any pattern, so i think that that's it.
and you might wanna post this as a new thread so that others may help.
cheers
I think you expecting this one,Take a look at this....,
Thanks & Best Regards,
Vignesh.B