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

Invalid Expression Error

Hi,

Please can someone assist in identifying what I am doing wrong.  The error message says that it is an invalid expression. It happens when i add the "MAX" command infront of the date.  Example of date = 30.05.201615:26:26

Code below :

TASKS:

LOAD PROCTY,

     TRART,

     PROCS,

     TOSTAT,

     MAX(timestamp(timestamp#(CONFIRMED_AT,'DD.MM.YYYYhh:mm:ss'),'YYYY/MM/DD hh:mm:ss')),

     VLENR,

     NLTYP

FROM

[..\..\ORDIM_C.QVD]

(qvd)

WHERE VLENR <> ' '

AND   PROCTY = 2015

AND   TOSTAT = 'C'

AND   NLTYP = 9025;

2 Replies
PrashantSangle

Hi,

max() is aggreagated function.

You need group by clause

try like

TASKS:

LOAD PROCTY,

     TRART,

     PROCS,

     TOSTAT,

     MAX(timestamp(timestamp#(CONFIRMED_AT,'DD.MM.YYYYhh:mm:ss'),'YYYY/MM/DD hh:mm:ss')),

     VLENR,

     NLTYP

FROM

[..\..\ORDIM_C.QVD]

(qvd)

WHERE VLENR <> ' '

AND   PROCTY = 2015

AND   TOSTAT = 'C'

AND   NLTYP = 9025

group by

PROCTY,

     TRART,

     PROCS,

     TOSTAT,

     VLENR,

     NLTYP;

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
vcanale
Partner - Creator II
Partner - Creator II

Hi,

MAX() is an aggr function..
try with a "group by" for the fields not used in the Max().

eg: Group by (Aggr in script)