Display item # depending on date

Im looking to display some text in a repeating group. I would like the format “062523-##” where 062523 is the date that the item was created, but ## is the index of the item only on that date, in order (01 is the first item on that day)

Say for example, on june 23, 2023 that 4 data items were created, and on june 24, 2023 2 items are created, I want to be able to display them in a single repeating group like:

item1 062323-01
item2 062323-02
item3 062323-03
item4 062323-04
item5 062423-01
item6 062423-02

the issue is that I have a data type with thousands of entries, so adding more fields would not work for me. I want to be able to do this with just creation dates. This is what I’ve got so far:

d3f346532ff1dc617716d33ef64839b1

1 Like

bump 44 views

Hi there, @sivercreeper101… I played around with this one for longer than I care to admit (I saw your post when you initially created it), and if we set aside the possible (or, rather, probable) inefficiencies when it comes to workload units and performance, I have something that appears to work given your requirement of only using the creation dates.

First, if you haven’t enabled the experimental parentheses feature, go to the Settings >> Versions tab and enable it (although, you might not actually need it, but I didn’t try without it). Second, I assume you are sorting the repeating group in ascending order by creation date. Those things being said, here is the expression.

expression1

Note that it is important that the Search for Call/s also be sorted in ascending order by creation date. Then, here is what the advanced filter looks like.

Here is what the results look like with some test data I threw in the database.

Anyway, that’s what I’ve got, and I hope it helps.

Best…
Mike

Thank you man. This was exactly what I was looking for!

1 Like

Cool… happy to help. Oh, and it just hit me that instead of doing the search, you can reference the repeating group’s list of things.

expression

I don’t necessarily know what kind/how much of a difference that will make, but it seems better than repeating the search.

2 Likes

@mikeloc, they are theoretically the same (a Thing that has already been fetched and cached shouldn’t be fetched again, and this shouldn’t incur WU), but since the RG’s list of things is available, this is preferable to use, if only syntactically. (And who knows exactly how WUs are being calculated. Best to avoid “Search for…” syntax when possible.)

3 Likes