Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to create a field that is the subtraction of 2 items. However 1 item I want to take the min value of. I would like something like this.
(Min(%ProgramAdmitDate_Num,1) - %EncounterAdmitDate_Num) as Program_delay
I am getting an error with this statement.
Thanks in advance for your help!
Frank
Try this:
Join (Fact)
Load [Patient ID#],
(Min(%ProgramAdmitDate_Num,1) as Min
Resident Fact
Where not IsNull(%ProgramDischargeDate_Num) and EncounterStatus ='Discharged' and RecoveryType='InPatient'
Group By [Patient ID#];
NewFact:
LOAD *,
Min - %EncounterAdmitDate_Num as Program_delay
Resident Fact;
DROP
Table Fact;
Can you share the complete script for this table? and is the min overall min or min by some dimension in this table?
Here is the full statement
I am joining this data to a Patient Summary table
Join
Load
[Patient ID#],
(Min(%ProgramAdmitDate_Num,1) - %EncounterAdmitDate_Num) as Program_delay
Resident Fact
Where not IsNull(%ProgramDischargeDate_Num) and EncounterStatus ='Discharged' and RecoveryType='InPatient';
Try this:
Join (Fact)
Load [Patient ID#],
(Min(%ProgramAdmitDate_Num,1) as Min
Resident Fact
Where not IsNull(%ProgramDischargeDate_Num) and EncounterStatus ='Discharged' and RecoveryType='InPatient'
Group By [Patient ID#];
NewFact:
LOAD *,
Min - %EncounterAdmitDate_Num as Program_delay
Resident Fact;
DROP
Table Fact;