# I'm new to Julia and I can't get this constraint to work

**URL:** https://discourse.julialang.org/t/im-new-to-julia-and-i-cant-get-this-constraint-to-work/34004
**Category:** General Usage
**Tags:** question
**Created:** [January 31, 2020, 1:33am UTC](https://discourse.julialang.org/t/im-new-to-julia-and-i-cant-get-this-constraint-to-work/34004 "2020-01-31T01:33:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![T\_S](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t_s/32/12568_2.png) [@T\_S](https://discourse.julialang.org/u/T_S)
#### Post date: [January 31, 2020, 1:33am UTC](https://discourse.julialang.org/t/im-new-to-julia-and-i-cant-get-this-constraint-to-work/34004/1 "2020-01-31T01:33:06Z")

</div>

I am using JuMP. here is the line:

```julia
@constraint(m, [i=1:size(sets)[2]], sum(sets[j,i]*apples_set[j] for j in 1:num_apples) + sum(sets[num_apples+j,i]*pears_set[j] for j in 1:num_pears) <= num_overlap)

```

Can someone atleast help break down what I wrote and help me fix it. apples\_set is a binary 1 dimension array of different apples. sets is 2 dimenions and each row represents represent a specific apple or pear and each column represents a single set. I want to limit the total amount of the same apple from appearing in multiple sets (rows in sets). When I optimize the results will show the same apple in each set even though num\_overlap will be 3 or a low number which means my constraint isn’t working.
