If for example,
I have a table list with various data in it. If suppose the same data gets repeated more than one time, so, how can we calculate the number of times it gets repeat. Like, XYZ is repeated 4 times, so, I want to create a separate column and show its count infront of its row. So, how to calculate that?
Hi Aditya,
You can use Group by on repeated column in aggregate
Hope this helps,
Kind Regards,
If you have rows with different times it is normal that if you group by them, you will get different counts.
As I see it, you have four options:
Kind Regards,João
For that scenario, you can on a query group by the elements that are repeated and make a count on another field.
Take a look at the example below where I want to see how many users have the same name. I do a query on the entity User, group by the Name attribute, and select a Count on the Id (just right click the column and select Count):
Hi Joao,
When i apply this, the aggregate entities get converted to a structure. So, Cant it be done by keeping entity as an entity only?
Yes, it will convert to structure, because there is a new field (count), that not in the original model entity.
Thanks
Hi Aditya, it will create a structure.
The same thing happens in SQL when you group by, it affects your output.
What you can do however is to group by multiple fields (not just the name on my example) and they will be added to the structure.
Take into account that if you group by fields that are different, you will have multiple rows, not just one.
It is affecting my display output. If,I group by Items and Id count its working perfect. But, i also need to show their respective date time and ip address. If I group by them too, then the count gets disturbed means count and its ids get repeated.
Can u please show me how to implement the second option. Because according to my requirement, I cannot implement the min and max to date time.
Or Else, suggest me an other option that wont disturb the count and will show the exact date time.
Regards,