Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 18, 2020 6:26 AM
(279 views)

I have data where a certain number of parts are used on a component before it is replaced. At the point when the component is replaced, the part count is reset to 1. I would like to create a column that increments the component count each time the part count is reset to 1. How would I do this?

I attached a picture of the part count over time to help with understanding how the data looks.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

```
If( Row() == 1,
x = 1,
If( :Part Count == 1,
x++,
x
)
);
x;
```

5 REPLIES 5

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Component Count Incrementing

This will be very easy to do, if you can tell me what is the indicator that the Component has replaced?

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Component Count Incrementing

The indicator that the component has been replaced is when the part count reverts to 1.

Is this what you needed?

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Component Count Incrementing

Here is a formula that will work

```
If( :Part Count == 1 | Row() == 1,
x = 1,
x
++);
x;
```

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Component Count Incrementing

It's quite simple. The steps are this:

- Sort Time column ascending
- Create new column "ComponentCount" with below formula:

```
New Column("ComponentCount", Numeric, Continuous, Formula(
If(Row() == 1, 0,
:PartCount == 1, Lag(:ComponentCount, 1) + 1
)
)
```

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

```
If( Row() == 1,
x = 1,
If( :Part Count == 1,
x++,
x
)
);
x;
```