Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis with greater/less than or equal to a variable

Hi

Ok so this works:

sum({<[Lead time (days)] ={">=101 <=176"} >}[Lead time (days)])

I have a variable called LowerBound and another called UpperBound and they contain the following expressions:

fractile(total<Stock#> [Lead time (days)],$(Percentile_Min)) and fractile(total<Stock#> [Lead time (days)],$(Percentile_Max))

$(Percentile_Min) = 0.25

$(Percentile_Min) = 0.75

I want to replace the hardcoded values with either the variables $(LowerBound) and $(UpperBound) or the expressions they contain.

Currently I can get nothing to work

This doesn’t work:

sum({1<[Lead time (days)]= {'">=$(=fractile(total<Stock#> [Lead time (days)])"','">=$(=$(Percentile_Min)))"'}>*
<
[Lead time (days)]= {'"<=$(=fractile(total<Stock#> [Lead time (days)])"','"<=$(=$(Percentile_Max)))"'}>}[Lead time (days)])

nor does this

=sum({1<[Lead time (days)]*={'$(UpperBound)'}>*<[Lead time (days)]/={'$(UpperBound)'}>}[Lead time (days)])

Please can you help?

1 Solution

Accepted Solutions
Not applicable
Author

Try this

sum({<[Lead time (days)]={">=$(=fractile(total<Stock#> [Lead time (days)],$(Percentile_Min))) <=$(=fractile(total<Stock#> [Lead time (days)],$(Percentile_Max)) )"}>}[Lead time (days)])

View solution in original post

4 Replies
Not applicable
Author

anyone got any ideas - or do I need to give more detail?

mdmukramali
Specialist III
Specialist III

Dear ,

Can you share the sample file.

Thanks,

Mukram

Not applicable
Author

Try this

sum({<[Lead time (days)]={">=$(=fractile(total<Stock#> [Lead time (days)],$(Percentile_Min))) <=$(=fractile(total<Stock#> [Lead time (days)],$(Percentile_Max)) )"}>}[Lead time (days)])

Not applicable
Author

Thank you very much - this works like a dream.

As yet I haven't quite figured out when I should use " or ' and in what order the $ and >= need to be.

Oli