Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I've tried to create a counter in script or dashboard but no luck, let say the column "counter" result counts according to ID, Name and Status values.
ID, Name, Status, Counter
1DD, Sam, Active, 1
1DD, John, Active, 1
1DD, Sam, Active, 2
3AA, Sam, Active, 1
3AA, Sam, Active, 2
3AA, Sam, Fail, 1
4GG, Sam, Fail, 1
4GG, Sam, Fail, 2
4GG, Sam, Active, 1
4GG, John, Fail, 1
4GG, Sam, Fail, 3
4GG, Sam, Active, 2
4GG, John, Fail, 2
4GG, Sam, Fail, 4
Thank you!
Hi @Majed84, I believe this is what you're looking for.
autonumber(recno(),ID& Name& Status) as Counter
I don't understand what you want to do, could you please explain a bit more?
@Majed84 Perhaps this way? This is Just assumption. //RowNo() to not remove the duplicate records. //Count1 is expected result.
LOAD *, RowNo() as RowNo, AutoNumber(ID1&Name&Status,IterNo()) as Counter1 Inline [
ID1, Name, Status, Counter
1DD, Sam, Active, 1
1DD, John, Active, 1
1DD, Sam, Active, 2
3AA, Sam, Active, 1
3AA, Sam, Active, 2
3AA, Sam, Fail, 1
4GG, Sam, Fail, 1
4GG, Sam, Fail, 2
4GG, Sam, Active, 1
4GG, John, Fail, 1
4GG, Sam, Fail, 3
4GG, Sam, Active, 2
4GG, John, Fail, 2
4GG, Sam, Fail, 4
];
hi,
as the example showing, I need to create a counter start with 1 or 0 and count +1 whenever all three columns matched (ID, Name, Status)
Hi @Majed84, I believe this is what you're looking for.
autonumber(recno(),ID& Name& Status) as Counter
If your table in the example is called ExampleTable this may be what you want (but I still don't quite understand what result you expect, it would be nice if you could give an example of the desired outcome based on your example).
left join(ExampleTable) load ID, Name, Status, sum(1) as uniquecounter resident ExampleTable group by ID, Name, Status;
This would give you a new field in the table, and on each row you would have a counter of how many times in the table that the row's specific combination of ID, Name and Status occurs.
But on the other hand: that is probably not what you want. Maybe someone else that already answered has a better understanding of your needs.
Big thanks, this is what I need
Note: it takes time with a big data. but it's working fine.