Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
KKumar92
Contributor III
Contributor III

Assign Selected Date as Today() Date

Hi,

I have assigned "Today()" for a measure to calculate the Date difference, the default it selects the system's date. Howwever, I have given a date filter option, where the user can select a date to view the performance on that given date.

I want to assign the Today() date to the Date that is being selected by the user in the filter option.

Please advise how this can be achieved.

Labels (3)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

It lika like you are calculating the max(Date) per row. As long you have Date as a dimension on that row Max (Date) = Date for all rows.

You can try to get the global max date by replacing your max(Date)  with max (TOTAL Date) or with $(=max(Date))

I hope that one of these will solve your issue. 

View solution in original post

6 Replies
Vegar
MVP
MVP

What about using max([date field]) instead of today in your expression in order to get the expression to follow user selections? 

KKumar92
Contributor III
Contributor III
Author

Hi Vegar,

When I used the Max(date) to calculate the date difference, I am getting an "Invalid" error. I have changed the format of the date to 'DD/MM/YYYY' through the load script.

Vegar
MVP
MVP

You need to be more specific, if not then it is hard to give precise help. Maybe you could be more specific in your describtion, maybe post a screenshot of what you are doing and of the error message you receive?

 

KKumar92
Contributor III
Contributor III
Author

Hi Vegar,

Apologies for the delay to respond, as I had some health issues and now back to work.

With reference to the question posted above, I am working on a AR Report, where I have to calculate the "Debtor Days" in two methods.

  1. Debtor Days As of Today(Current System Date)
    • Formula = Today() - Date
  2. Debtor Days As of Max(Date) of the Date Range Selected.
    • Max(Date) - Date

Please find the screen shots below your reference,  In "Dashboard Before Selection" it display the Debtor Days as per system date, however in the "Dashboard After Selection" I have selected Date Range from 2020/12/05 to 2021/01/03. The selection will make "2021/01/03" as my Max Date, but the measure generates "0" value for the Measure Debtor Days A/F Selected Date.

Please advise how this could be resolved as achieve the expected results.

Vegar
MVP
MVP

It lika like you are calculating the max(Date) per row. As long you have Date as a dimension on that row Max (Date) = Date for all rows.

You can try to get the global max date by replacing your max(Date)  with max (TOTAL Date) or with $(=max(Date))

I hope that one of these will solve your issue. 

KKumar92
Contributor III
Contributor III
Author

Thanks for the Solution, max(Total Date) is working and I am getting the expected Answers.

Thanks for the support.