Hi all,
How can I write an integer value counter to increment unique values in column B within group A, to do this?
Here is what I have tried so far:
dt_Table1 = Data Table("Table1");
dt_Table1 << New Column("Dataset", Numeric, "Nominal", Set Selected);
Sum1 = dt_Table1 << Summary(Group(:Group, :Date));
Sum2 = Sum1 << Summary(Group(:Group));
:N Rows << Set Name("N Datasets in Group");
dt_Table1 << Update(
with(Data Table(Sum2)),
Merge Same Name Columns
Match Flag(0),
Suppress foruma evaluation(0),
By Matching Columns(:Group = :Group),
Drop multiples(1, 0),
Include Nonmatches(0, 0),
Preserve main table order(1)
);
dt = dt_Table1;
For(i = 1, i <= :N Rows(dt), i++,
While(Group_Number = GetValue(:Group[i]),
N == Get Value(dt, :N Datasets in Group[i]),
For(j = 1, j <= N, j++,
:Dataset << Set Value == (j),
),
Group_Number = Group_Number + 1,
),
);
Outputs: