Juan Lopez
Juan Lopez

Reputation: 21

Modeler question: Is there a function in SPSS for multiple 'if' statements? Forecasting dates

I am trying to build a forecast for interest expense for floating debt in my company.

I have been given a set of ResetDates which help me match a given rate based on when the ResetDate is.

I have been successful in forecasting one period, but I need a much longer set of periods to satisfy my requirements.

I've tried derive nodes and nested if statements as well as filler nodes.

I am given this data to work with, I can only look at one ResetDate ahead.

Here you will find the data I used: Columns A/B/C/D is what i'm given, Column E (or 5th column from left to right) is what I want to derive as my output

I want to use 'InterestPayDate' and derive:

if it's more than 'NextReset' , the add 90 days to the 'NextReset' to create 'NextReset2'

That is as far as I can get.... where my problem lies is I want to look at NextReset2 and derive:

if 'InterestPayDate' is more than 'NextReset2', then add 90 days to 'NextReset2', if it's less than 'NextReset2', keep the current value for 'NextReset2'

Output should look like Column E here

Not sure if I need to dig deeper into the logical functions, in all honesty, I've just picked up SPSS and I am really trying to learn. Hopefully, you can point me in the right direction.

Thank you.

Upvotes: 0

Views: 1066

Answers (1)

Kenneth
Kenneth

Reputation: 426

After computing the first NextReset2, you need to use a Filler node like the one below to change the value of the field.

enter image description here

You might need more than one identical nodes like this - one for each potential 90-day period that you are looking to extend the NextReset2 date. In your sample data, you will need at least two Filler nodes to get the correct value of NextReset2 for the last of the records. There might be a more elegant way to do it, but this will work and it's easy enough to make copies of a node and string them together like this.

Please also see a sample IBM SPSS Modeler stream showing this approach here and using your sample data.

Upvotes: 1

Related Questions