Forum Discussion
Saxon202202
1 year agoHelper III
Group By From-To Text without duplication
Hi, I hava data contain following columns are type, bin, section, bay and level. Logic1 If bay hasall the level from A to E range according to the Type, Section, Bay and Level then return...
Saxon202202
1 year agoHelper III
danextian and Anonymous.
Thanks for your reply and sorry for the late reply.
Given a dataset with columns such as Type, Bin, Section, Bay, and Level, you need to group the data by Section and Bay and check if all levels from A to E are present within each group. If all levels are present, you should return a single range representing the bay. If not all levels are present, you should return specific ranges for those levels. The final output should combine these results into one string.
Logic:
- Logic 1 (Full Range of Levels Present):
- If a particular Bay has all levels from A to E (or whatever the full set is), return a range combining all of them, e.g., A03-A05.
- Logic 2 (Partial Levels Present):
- If a particular Bay does not have all levels from A to E, identify the specific levels present and return the ranges for these levels, e.g., A01D-A02D.
Combined Result:
Combine the results from Logic 1 and Logic 2 into a single output string for each Section. For example, if a section has one complete bay and another with partial levels, the result should look like A01D-A02D, A03-A05.
Criteria:
- Criteria for Full Range: A bay must have all levels from A to E.
- Partial Levels: Identify any missing levels and include only the ranges that are present.
danextian
1 year agoSuper User
hi Saxon202202
You explanation is still unclear. You mentioned that a bay must have all levels. Bay A22 only has levels A, B and D and yet it based on the desired result, logic 2 is applied.