## Filling the missing dates in column

Solved
Occasional Contributor
Posts: 6

# Filling the missing dates in column

I would like to fill in for missing dates in the following data. Additionally, I would like to

keep the former value of the wt-variable on the filled in dates. The first part went well while I have

problems with the last step. Variations over lags have not worked */

Accepted Solutions
Solution
‎01-04-2017 03:27 PM
Super User
Posts: 13,583

## Re: Filling the missing dates in column

Using lags it best to make them unconditional. You have placed a lag cal within multiple IF clauses.

Better would be BEFORE all of the if:

Lagwt = Lag(wt);

then replace your

wt= lag(wt)

with

wt = lagwt;

and then drop the Lagwt variable.

Note that another function similar to lag is DIF.  So you can address Dif(daymonthyear) in the same manner as Lag, with the same warning about conditional use.

All Replies
Solution
‎01-04-2017 03:27 PM
Super User
Posts: 13,583

## Re: Filling the missing dates in column

Using lags it best to make them unconditional. You have placed a lag cal within multiple IF clauses.

Better would be BEFORE all of the if:

Lagwt = Lag(wt);

then replace your

wt= lag(wt)

with

wt = lagwt;

and then drop the Lagwt variable.

Note that another function similar to lag is DIF.  So you can address Dif(daymonthyear) in the same manner as Lag, with the same warning about conditional use.

Occasional Contributor
Posts: 6

## Re: Filling the missing dates in column

Thanks! Worked well!
☑ This topic is solved.