Thanks for you reply. What do I need to do in the section that loads the .qvd file that the Excel file joins to? I have the following two lines which represent the two ways that the spread sheet can join. The [Med ID] field will always exist in the .qvd but won't always have a match in the Excel (in the Excel file it could be populated but not be a match) in that case I want to join using the SIMPLE_GENERIC_C.
Date(ACTION_INSTANT)&'|'&MRN&'|'&[Med ID] as lloydsJoin,
Date(ACTION_INSTANT)&'|'&MRN&'|'&SIMPLE_GENERIC_C as lloydsJoinSM,