Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
segerchr
Contributor III
Contributor III

SQL Statement max and additional data

Hey, maybe you can help me with a SQL script or maybe with a solution directly in Qlik. 

I have the following table: 

Notebookname (N), Logindate (N), Loginname (N)

How can I get the following:

Notebookname (1), max(Logindate ) ,Loginname (related to max logindate)

For example:

Name1     2019.01.01     Tester1

Name2     2019.01.02     Tester1

Name1     2019.01.03     Tester3

Name3     2019.01.04     Tester4

Name2     2019.01.03     Tester5

My goal is to got the following information:

Name1     2019.01.03     Tester3

Name2     2019.01.03     Tester5

Name3     2019.01.04     Tester4

 

Thanks Christian

 

2 Replies
sunny_talwar

May be this

LOAD Notebookname,
     Max(Logindate),
     FirstSortedValue(Loginname, -Logindate)
FROM ...
Group By Notebookname;
consultant_bi
Creator
Creator

hello ,


you can use this SQl line on Qlik Script : 
[tableName_Qlik]:
load * ;

Sql
Select Notebookname , max(Logindate ) ,Loginname    

from Table group by Notebookname , Loginname ;