- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to increment based on empty rows
Hi,
I'd like to create a new column formula that increments (1, 2, 3....) only when empty rows are found (e.g. column 7 below).
Would you have a solution?
Thank you
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to increment based on empty rows
Created:
Mar 13, 2024 09:28 AM
| Last Modified: Mar 13, 2024 6:29 AM
(804 views)
| Posted in reply to message from LargeElk892 03-13-2024
Here is one way to handle your issue. Assuming that all of your columns are numeric, this will work
As Constant(
count = 1;
lagFlag = 0;
dt = Current Data Table();
);
If( Is Missing( Sum( dt[Row(), 0] ) ) == 0,
If( lagFlag == 1,
count++;
lagFlag = 0;
)
,
lagFlag = 1
);
If( lagFlag == 0, count );
Jim
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to increment based on empty rows
Using formula with Lag() is most likely easiest option. Could you provide example with the result you want to have?
-Jarmo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to increment based on empty rows
Created:
Mar 13, 2024 09:28 AM
| Last Modified: Mar 13, 2024 6:29 AM
(805 views)
| Posted in reply to message from LargeElk892 03-13-2024
Here is one way to handle your issue. Assuming that all of your columns are numeric, this will work
As Constant(
count = 1;
lagFlag = 0;
dt = Current Data Table();
);
If( Is Missing( Sum( dt[Row(), 0] ) ) == 0,
If( lagFlag == 1,
count++;
lagFlag = 0;
)
,
lagFlag = 1
);
If( lagFlag == 0, count );
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to increment based on empty rows
Thank you very much Jim! I took me quite some time to go through each block to understand the logic but I finally got it