# A capsule between two different capsules

## Recommended Posts

Hi,
How Can I select Capsule C those are between two different capsules (A and B)?
It means I am looking for Capsules of Cs those are started after capsule A and finished before capsule B.

Thanks

##### Share on other sites

• Seeq Team

This can be achieved by using Composite Condition tools. Select combination method of Join. Please make sure you uncheck "Inclusive of A" and "Inclusive of B" in order to create capsule between A and B.

You can also refer to this example on how to use composite condition with join function:

https://www.seeq.org/index.php?/forums/topic/625-creating-a-condition-for-equipment-start-up/&do=findComment&comment=1105

Edited by Siti Tay
##### Share on other sites

Hi Siti Tay,

There are two problems for using the Join with unchecking "Inclusive of A" and "Inclusive of B":
1- I have different size of capsules 1 hr to 5 hr. When I increase the amount of maximum capsule
duration, Capsule C starts from capsule A that is one before the left side of C, see below:

A=amount of maximum capsule duration=2hr (I could not see a capsule between A1 and B1)
B=amount of maximum capsule duration=3hr (Now, Capsule C is incorrect)

I want something to join just two different capsules (A,B) before and after a capsule for any duration When capsule A is before B.

2-also in join, I have to select two different capsules, Sometimes I have to find capsule C between two capsules A when the duration is less than a certain amount.

Thanks again,

##### Share on other sites

• Seeq Team

Here are the steps to get Condition C:

Step 1: Create ''Condition C1'' by joining ''Condition A'' and ''Condition B'' using this formula :

`\$a.afterEnd(0ns).join(\$b.beforeStart(0ns), 40h, false)`

Step 2: Create ''Condition C2'' using inverse function in formula and specify the duration. For example 10 min. Only capsule shorter than 10 min will be returned.

`\$conditionA.inverse().removeLongerThan(10min)`

Step 3. Combine ''Condition C1'' and ''Condition C2'' using CombineWith function in formula

`combineWith(\$C1, \$C2)`

Let me know if this works.

##### Share on other sites

Thanks a lot for your help.

• 1

## Create an account

Register a new account