How To Count Old Data? Please read for clarification

Hello, thank you for taking a look at this. I really appreciate it.
I am wanting to figure out a way to count old/deleted data. I will explain this below.

This app is a classified app. Users post listings for items to be sold… Pretty simple.

Data structured:
USER (DataType) creates LISTINGS (DataType). LISTINGS are then displayed for all to see. That is it. once again, simple.

All LISTINGS are self-deleted after 30 days. This is done by a backend workflow.
All USERS that are inactive for over 30 days are self-deleted. This is also done by a backend workflow. (User never does sign up/password nor profile. Everything is done by email verification).

I am wanting to create an admin dashboard to display how many ACTIVE users and how many ACTIVE listings. I fully understand how to do this with ACTIVE data but I am also wanting to display how many listings and users have been created since app launch. Seeing that LISTINGS and USERS are deleted after 30 days, how would I count/keep track of how many Users and Listings have been created since launch?

Please let me know if you have any ideas on how to create a counter of some sorts or if you have a totally different idea.

Once again, thank you for your time and knowledge!

Well… obviously you can’t count deleted things.

So you have two options.

  1. Don’t actually delete them - just mark them as deleted (or archived).

  2. Store the number of things you’ve deleted somewhere else, and update that number whenever you delete a new thing.

Option 1 is certainty the simplest, and probably the best for a whole list of reasons, and certainly what I would do.

Hi @adamhholmes Thank you for replying.

I agree with everything you wrote.
Not deleting them and just “hiding them” is what is looking to be easiest however how would you go about storing the numbers somewhere else?
This is what I have been trying to figure out. Thank you again!

I’d just have a datatype to store things like Deleted Listings Count, and before deleting any thing, just update the count by adding the number of things you’re about to delete.

Obviously, jus storing the count won’t give you any further information about those things, so you won’t be able to do much with that info - hence why it’s much better to mark them as deleted unless you’re really don’t need to know anything about them other than the number.

1 Like

Once again, thank you for your input!

2 Likes