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: 
D19PAL
Creator II
Creator II

Why isn't my max date working

Hi,

Why is this not working?

Lib connect to *****;

 

Load

Regions,

Timestamp;

Test:

Select 

Regions,

Timestamp 

From "testdata";

Noconcatenate

Load

*,

Max(Timestamp) as test

Resident Test

Group by Regions;

 

I get invalid expressions 

 

 

1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

Right, what @Or said.  your grouped by statement has Timestamp as a field but not part of the group by.  Assuming you don't want to group by Timestamp if you are aggregating by it.

 

Load

Regions,

Timestamp;

Test:

Select 

Regions,

Timestamp 

From "testdata";

Noconcatenate

Load

Regions,

Max(Timestamp) as test

Resident Test

Group by Regions;

View solution in original post

5 Replies
Or
MVP
MVP

You're loading Timestamp (as part of '*') but it's not in the Group By expression, seemingly?

D19PAL
Creator II
Creator II
Author

I tried it, still doesn't work.

 

Can you show it as a syntax example please.

 

Thanks 

Or
MVP
MVP

I can't, as you did not include sample data (or the error message you get).

stevejoyce
Specialist II
Specialist II

Right, what @Or said.  your grouped by statement has Timestamp as a field but not part of the group by.  Assuming you don't want to group by Timestamp if you are aggregating by it.

 

Load

Regions,

Timestamp;

Test:

Select 

Regions,

Timestamp 

From "testdata";

Noconcatenate

Load

Regions,

Max(Timestamp) as test

Resident Test

Group by Regions;

D19PAL
Creator II
Creator II
Author

Where I got group by Regions, does it need to be

 

Group by Timestamp, Regions;

 

The following error occurred:

Invalid expression