Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am extracting data from a source and would want to do the following action before loading the data into QV:
How can this be accomplished in QV before/during the loading process?
Regards.
May be something like this:
LOAD If(Len(Trim([Doctor Number])) = 0, '00000', [Doctor Number]) as [Doctor Number],
If(Len(Trim([Med Aid])) = 0, 'UNKNOWN', [Med Aid]) as [Med Aid
OtherFields
FROM Source;
LOAD
If(Len(Trim([Doctor Number])), [Doctor Number], '00000') AS [Doctor Number],
If(Len(Trim([Med Aid])), [Med Aid], 'UNKNONW') AS [Med Aid],
...
FROM ...;
May be something like this:
LOAD If(Len(Trim([Doctor Number])) = 0, '00000', [Doctor Number]) as [Doctor Number],
If(Len(Trim([Med Aid])) = 0, 'UNKNOWN', [Med Aid]) as [Med Aid
OtherFields
FROM Source;
Thank you Swuehl
Your script seems not have a value for the Len function?
Hi,
LOAD If(IsNull([Doctor Number]), '00000', [Doctor Number]) as [Doctor Number],
If(IsNull([Med Aid]), 'UNKNOWN', [Med Aid]) as [Med Aid]
FROM Source;
HTH,
Hirish
Thanks Sunny, this should do the trick. Confirm, from the script, if the [Doctor Number] or [Med Aid] are not null the existing field value is loaded?
Regards.
Yup. If they have values, they will be picked
If Len() returns zero, the if() statement will execute the ELSE branch, if it returns a number, the THEN branch.
You don't need to check for zero explicitely, but you can do, if you want.
Thanks Hirish for your input, most appreciated. Is there a difference from using the Len and Trim functions as per Sunny's recommendations on this forum? Which is the most efficient if there are no differences?
Regards.
Ok thanks Swuehl