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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Invalid Expression attempting to get MaxDate

[Loss Mit Steps 324]:

LOAD [Loan Number] as ln_no_324,

  [Ls Step Code] as step_cd_324,
  Max([Ls Actual Completion Date]) as s324_Dt,
  [Record Change Code]
FROM
(qvd)
where match([Ls Step Code],'324')
and match([Record Change Code],'A','C')
group by [Loan Number]

I am attempting to show the maxdate and row for a table.  The issue is the table tends to have duplicate or repeating fields.  I keep getting Invalid expression however when I debug it does not pinpoint exactly where the invalid expression occurs.

2 Replies
maxgro
MVP
MVP

you have to group by all fields where there isn't an aggregation function; added in bold

[Loss Mit Steps 324]:

LOAD

  [Loan Number] as ln_no_324,

  [Ls Step Code] as step_cd_324,
  Max([Ls Actual Completion Date]) as s324_Dt,
  [Record Change Code]
FROM
(qvd)
where match([Ls Step Code],'324')
and match([Record Change Code],'A','C')
group by

[Loan Number],

[Ls Step Code],

[Record Change Code]

PrashantSangle

Hi,

Yes it will through you error for Group By clause.

Instead of using only [Loan Number]

you have to use all the fields excluding those fields on which you are using aggregate function .

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 🙂