How to find the days count in Topic Search

I need to calculate the days count based on the user query from Search. Currently I am using a calculated field as below,
days count = (dateDiff(min({Local Time At}),max({Local Time At}),“DD”)+1)

If I query days count it is giving 7 for last week and 31 for last month and so on.
But if I use it in another calculated filed , it is taking how many days the data is present for.

How to find the days count in generic level and not based on the data in Topic Search?

Can you give me an example of what you are looking for?

So in a different calculated field you want it to be based off of the 7 for the last week or so?

If so, have you applied the same filter to the other visuals?

Hi @Max ,
This is with respect to Topic in Quicksight

I need to use the days count in one of the calculated field. How to do it based on the user query dynamically.?
eg. For last week - days count is 7
For last month - days count is 31

Consider if I need to calculate stop time , and I need days count based on user query dynamically.
stop time = (24 * days count) - trip duration
Query from user in topic : show me the stop time for last week by vehicle
it should be (24 * 7) - 60

I might not be understanding this correctly:

You want to be able to search by stop time, and define that stop calculation somewhere in a calculated field?

Have you taken a look at this document?

The issue I think here is that you either need to filter down to those days or handle it in the calculated field.

I would first suggest filtering down and having the calculated field count the days after you have filtered.

Let me know if any of this helps.