Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
TomBond77
Specialist
Specialist

Loop in a script

Hi experts

I have this loading script:

[fact_temp]:

....

if(monthend(date(floor(Timestamp), 'YYYY-MMM'))= monthend(date(Addmonths(MonthEnd(Today()),-1), 'YYYY-MMM')), [Event Reason]) as [Event Reason_new]

Now I need to overwrite [Event Reason] by [Event Reason_new], the statement below is not sufficient. Do yu

[Fact]:

Load *,
if(Leaver=1 and isNull([Voluntary/Involuntary]), [Event Reason_new], [Event Reason_old]) as [Event Reason]
Resident [fact_temp];

Any ideas how to solve?

TomBond77_1-1708337977600.png

 

 

 

Labels (5)
1 Reply
Anil_Babu_Samineni

@TomBond77 Perhaps the null is not really null? You can replace null with Len() if that helps.

if(Leaver=1 and Len([Voluntary/Involuntary])=0, [Event Reason_new], [Event Reason_old]) as [Event Reason]

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful