Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Hi,
Try to use Calculated dimension =if(Date=max(total Date),Date).
And check Suppress When Value Is Null
BR,
Konstantins
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
So, where is the problem? This SQL query looks OK. What is the result of it? And which graphic you want to create?
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.
I've tested your first SQL. It works. You said that MAX(DATE) doesn't work. Where? In the script or in the object?
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