Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max(Date) on Graphic

Hi,

I'm new to Qlikview and try to do one thing creating a graphic - simple table

With such records :

account, action, date

I want to retrieve only the last actions by account (using max(date)). So I use expression :

Max ([Date])

but it doesn't work, Can you help me?

Thanks in advance.

6 Replies
skaredovs
Partner - Creator
Partner - Creator

Hi,

Try to use Calculated dimension =if(Date=max(total Date),Date).

And check Suppress When Value Is Null

BR,

Konstantins

Not applicable
Author

Thanks Konstantins.

Here, it's only retrieve the last action. I'd want the last action per account, any idea? The equivalent in SQL :

SELECT ACCOUNT,

ACTION,

MAX (DATE)

FROM TABLE

GROUP BY ACCOUNT, ACTION

skaredovs
Partner - Creator
Partner - Creator

So, where is the problem? This SQL query looks OK. What is the result of it? And which graphic you want to create?

Not applicable
Author

My Last SQL is my objective.

issue you gave me would be the equivalent SQL :

SELECT ACCOUNT,

ACTION,

DATE

FROM TABLE

WHERE DATE = (SELECT MAX(DATE) from TABLE)

... which is not my requirement.

skaredovs
Partner - Creator
Partner - Creator

I've tested your first SQL. It works. You said that MAX(DATE) doesn't work. Where? In the script or in the object?

skaredovs
Partner - Creator
Partner - Creator

The good practice is to read all the data and to show in the object (to calculate) only necessary in this object.

In your case I would recommend to read from SQL all records. Then in the object use calculated dimension as I mentioned in my 1st post.

BR,

Konstantins