# Missing condition in "elseif" at none

**URL:** <https://discourse.julialang.org/t/missing-condition-in-elseif-at-none/29754>\
**Category:** New to Julia\
**Created:** [October 10, 2019, 9:37pm UTC](https://discourse.julialang.org/t/missing-condition-in-elseif-at-none/29754 "2019-10-10T21:37:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hasanOryx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hasanoryx/32/5373_2.png) [@hasanOryx](https://discourse.julialang.org/u/hasanOryx)\
**Post date:** [October 10, 2019, 9:37pm UTC](https://discourse.julialang.org/t/missing-condition-in-elseif-at-none/29754/1 "2019-10-10T21:37:55Z")

</div>

I got this error:

```bash
syntax: missing condition in "elseif" at none:13

```

for this code, what the mistake I made?

```julia
function triple_exponential_smoothing(series, slen, α, β, γ, n_preds)
    seasonals = initial_seasonal_components(series, slen)
    println("The seasonalities are: $seasonals")
    result = []
    smooth = 0.0
    trend = 0.0
    for i in (0:length(series) + n_preds)
        if i == 0 # iniial value
                smooth = series[1]
                trend = initial_trend(series, slen)
                println!("The initial_trend is: $trend")
                push!(result, series[1])
        elseif
            i >= length(series) # we are forecasting
                m = i - series.len() + 1
                push!(result, (smooth + m * trend) + seasonals[i % slen])
        else # we are simulating history
                val = series[i]
                last_smooth = smooth
                smooth = α * (val - seasonals[i % slen]) +
                    (1.0 - α)*(smooth + trend)
                trend = β * (smooth - last_smooth) + (1.0 - β) * trend
                seasonals[i % slen] = γ * (val - smooth) +
                    (1.0 - γ) * seasonals[i % slen]
                push!(result, smooth + trend + seasonals[i % slen])
        end
    end
end

```

---

<div class="post-metadata">

**Author:** ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)\
**Post date:** [October 10, 2019, 9:42pm UTC](https://discourse.julialang.org/t/missing-condition-in-elseif-at-none/29754/2 "2019-10-10T21:42:38Z")

</div>

`?elseif`

---

<div class="post-metadata">

**Author:** ![hasanOryx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hasanoryx/32/5373_2.png) [@hasanOryx](https://discourse.julialang.org/u/hasanOryx)\
**Post date:** [October 10, 2019, 9:47pm UTC](https://discourse.julialang.org/t/missing-condition-in-elseif-at-none/29754/3 "2019-10-10T21:47:48Z")

</div>

Did not get it, where to put it, I already used `else` as if nothing of the above, where to use `elseif` and what condition shall I put if I have nothing except the above?

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [October 10, 2019, 9:47pm UTC](https://discourse.julialang.org/t/missing-condition-in-elseif-at-none/29754/4 "2019-10-10T21:47:58Z")

</div>

I believe you cannot start a new line after elseif.

---

<div class="post-metadata">

**Author:** ![hasanOryx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hasanoryx/32/5373_2.png) [@hasanOryx](https://discourse.julialang.org/u/hasanOryx)\
**Post date:** [October 10, 2019, 9:50pm UTC](https://discourse.julialang.org/t/missing-condition-in-elseif-at-none/29754/5 "2019-10-10T21:50:46Z")

</div>

Thanks a lot, this was the issue

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [October 10, 2019, 9:59pm UTC](https://discourse.julialang.org/t/missing-condition-in-elseif-at-none/29754/6 "2019-10-10T21:59:33Z")

</div>

IMHO, judging from your post history of past ~3days, docs should be a quicker solution for many of your questions. Or try Slack, in case you just need a pointer to a doc or some syntax correction.
