Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am running into an issue with my LEFT JOINs. When I reload my data nothing is loaded. I am not sure what I need to change in my script. Any help would be greatly appreciated. I have attached a Word File containing my script for you to view.
Listed below are some of my steps to get to where I am at.
Thanks for your help.
Brian
My guess is you should add a noconcatenate for RevenueAndUsage_Final to prevent it being added to RevenueAndUsage_Temp2. When you drop that temp table you are left with nothing.
RevenueAndUsage_Final:
NOCONCATENATE LOAD [Plan Code],
Facility,
...etc
Also, you could replace this
LEFT JOIN
LOAD [CDM Procedure Code],
[Current Price]
FROM
[(7) IU Health - Supply Pricing Data.xlsx]
(ooxml, embedded labels, table is CDM);
with a mapping table and use applymap instead of joining.
CDMPriceMap:
LOAD [CDM Procedure Code],
[Current Price]
FROM
[(7) IU Health - Supply Pricing Data.xlsx]
(ooxml, embedded labels, table is CDM);
//***********Revenue & Usage Temp*************
RevenueAndUsage_Temp:
LOAD [Plan Code],
Facility,
[Patient Type],
[Department Number],
[CDM Procedure Code],
applymap('CDMPriceMap',[CDM Procedure Code]) as [Current Price]
Volume,
...etc
My guess is you should add a noconcatenate for RevenueAndUsage_Final to prevent it being added to RevenueAndUsage_Temp2. When you drop that temp table you are left with nothing.
RevenueAndUsage_Final:
NOCONCATENATE LOAD [Plan Code],
Facility,
...etc
Also, you could replace this
LEFT JOIN
LOAD [CDM Procedure Code],
[Current Price]
FROM
[(7) IU Health - Supply Pricing Data.xlsx]
(ooxml, embedded labels, table is CDM);
with a mapping table and use applymap instead of joining.
CDMPriceMap:
LOAD [CDM Procedure Code],
[Current Price]
FROM
[(7) IU Health - Supply Pricing Data.xlsx]
(ooxml, embedded labels, table is CDM);
//***********Revenue & Usage Temp*************
RevenueAndUsage_Temp:
LOAD [Plan Code],
Facility,
[Patient Type],
[Department Number],
[CDM Procedure Code],
applymap('CDMPriceMap',[CDM Procedure Code]) as [Current Price]
Volume,
...etc