Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

max(date) for each client computer

Good morning everybody,

I hope someone can give me a hint, how I can add an new field to my data model that shows the highest compliance date for a client computer. I found several ideas but I could not find the right solution for my issue...

I import a number of daily built raw-data tables (source is csv) into a .qvd and afterwards load them into my application. My challenge is now to find the highest date that is found in a certain field and add it to a new table that is linked to my data model via ClientID.


The Client ID appears several times with different LastComplianceTime-values (including NULL). I want to keep the values for creating data history.

Now I need a function that produces a new field called "MaxLastComplianceTime" that is filled for each client with the maximum value in the date field "LastComplianceTime". In the example below it would be "08.09.2016" for client D0000015 resp. "20.09.2016" (DD.MM.YYYY) for client D0000016.

rawData:

ClientIDLastComplianceTime
D0000015
D000001508.09.2016
D000001508.09.2016
D000001506.09.2016
D000001505.09.2016
D000001620.09.2016
D000001613.09.2016
D000001630.08.2016
D000001630.08.2016
D0000016

Desired result:

MaxComplianceTime:

ClientIDMaxLastComplianceTime
D000001508.09.2016
D000001620.09.2016

I appreciate every approach!

Thanks in advance for your support!

Greetings, Marcus

5 Replies
m_woolf
Master II
Master II

join load

     ClientID,

     Max(LastComplianceTime) as MaxLastComplianceTime

resident Your Table Name

Group By ClientID;

MarcoWedel

MaxComplianceTime:

LOAD ClientID,

          Date(Max(LastComplianceTime)) as MaxLastComplianceTime

Resident rawData

Group By ClientID;


hope this helps


regards


Marco

Not applicable
Author

Hello Marco,

wow, it works! Thank you so much!

Greetings, Marcus

Not applicable
Author

Hello m w,

thank you for your reply! This helps a lot!

Greetings, Marcus

MarcoWedel

Hi,

glad it worked.

Please close your thread if your question is answered.

Thanks

Regards

Marco