Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on February 20, 2022 1:59AM
Likes: 0
Replies: 4
please, how do I parse this in the prepare recipe . I keep getting errors
if(LBTESTCD = VLDLCP3","VLDL & Chylomicron Particles",
if(LBTESTCD = VLCP3","Large VLDL & Chylomicron Particles",
if(LBTESTCD = VMP3","Medium VLDL Particles",
if(LBTESTCD = VSP3","Small VLDL Particles",
if(LBTESTCD = LDLP3","LDL Particles",
if(LBTESTCD = IDLP3","IDL Particles",
if(LBTESTCD = LLP3","Large LDL Particles",
if(LBTESTCD = LSP3","Small LDL Particles",
if(LBTESTCD = HDLP3","HDL Particles",
if(LBTESTCD = HLP3","Large HDL Particles",
if(LBTESTCD = HMP3","Medium HDL Particles",
if(LBTESTCD = HSP3","Small HDL Particles",
if(LBTESTCD = VZ3","VLDL Size",
if(LBTESTCD = LZ3","LDL Size",
if(LBTESTCD = HZ3","HDL Size",
if(LBTESTCD = LPIR","Lipoprotein Insulin Resistance Score",
if(LBTESTCD = ELP_TC","Total Cholesterol",
if(LBTESTCD = ELP_HDLC","HDL Cholesterol",
if(LBTESTCD = ELP_TG","Triglycerides",
if(LBTESTCD = ELP_APOB","ApoB",
if(LBTESTCD = ELP_LDLC","LDL Cholesterol",
if(LBTESTCD = ELP_VLDLC","VLDL Cholesterol",
if(LBTESTCD = ELP_NONHDLC","Non HDL Cholesterol")))))))))))))))))))))))
Hi,
I suggest you use a reference data table to define those relationships, rather than hardcode them in a complex if statement:
Your flow should look similar to the attached image.
I hope this helps.
Great suggestion @Manuel
, a lot more manageable that way!
@Scobbyy2k3
it looks like something is missing in your formula : take for example the first line : if(LBTESTCD = VLDLCP3","VLDL & Chylomicron Particles",
Change that to if(LBTESTCD == "VLDLCP3","VLDL & Chylomicron Particles",
>> the comparison operator is == and there seems to be missing a double quote in every line.
Hope this helps!
Jurre
Having such logic on a nested if statement also has an impact on performance:
Best regards
Thank you all, i have it fixed