Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following expression in a straight table in my QV application:
IF(InsID1='SP' OR isnull(InsID1) and
isnull(InsID2) and
isnull(InsID3) and
isnull(InsID4) and
isnull(InsID5),'Uninsured','Insured')
It works fine as an expression in the chart, but I want to move this to the script, creating a new field called InsuranceStatus, that would have a value of either Insured or Uninsured. So far, my attempts to include this in the script have failed. It's probably a syntax thing.
Can anyone offer some ideas?
Yes, you will need to make something like
IF(InsID1='SP' OR (isnull(InsID1) and isnull(InsID2) and isnull(InsID3) and isnull(InsID4) and isnull(InsID5)),'Uninsured','Insured') as InsuranceStatus,
I've forgot to put that on the "if".
Regards,
Gabriel
Can you paste in the load statement script you have so far ?
Hi!
Are you finding script errors, or the if doesn't shows the result that you're expecting? Maybe will need to include some parentheses on that if expression.
IF(InsID1='SP' OR (isnull(InsID1) and isnull(InsID2) and isnull(InsID3) and isnull(InsID4) and isnull(InsID5)),'Uninsured','Insured')
Regards,
Gabriel
Hi, Gabriel.
I tried the same thing, but the script does not like the comma before "Uninsured'. I think I'd need to add something like "AS InsuranceStatus" in there somewhere to create and populate the new field.
Bill, the script is long and complicated, and would probably detract from the conversation on this particular issue.
Yes, you will need to make something like
IF(InsID1='SP' OR (isnull(InsID1) and isnull(InsID2) and isnull(InsID3) and isnull(InsID4) and isnull(InsID5)),'Uninsured','Insured') as InsuranceStatus,
I've forgot to put that on the "if".
Regards,
Gabriel
Thanks, Gabriel. That worked perfectly! I'm not sure what I missed, but you found it.