Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

temp table error in script

Hello all,

I made a Temp Table resident on my main table which looks like this:

TempOrders:

LOAD  unit,
field1,
max(orderID) as [Max order],
timestamp(max(date("OrderDate",'YYYY-MM-DD hh:mm:ss.fff'))) as [Max order date],
Check,
Center,

Year,

Code

resident Orders

where  Product='This'
group by unit,field1,orderID,OrderDate,Check,Center,Year,Code;

 

But i just want the group by to be by unit,OrderDate and orderID.

My problem is, Qlik (or something most probably that i dont do right) won't let me group by just by what i need but needs every other field, or else it shows the error  "Invalid Expression" .

For my case the above for Product='This' gives me two dates because of there being two different Check types.

Help? 😬

 

1 Solution

Accepted Solutions
sunny_talwar

If you want to just Group by unit.... (why group by  the fields which you are aggregating?)... may be try this

TempOrders:
LOAD unit,
     Max(orderID) as [Max order],
     TimeStamp(Max("OrderDate")) as [Max order date]
Resident Orders
Where Product = 'This'
Group By unit;

View solution in original post

1 Reply
sunny_talwar

If you want to just Group by unit.... (why group by  the fields which you are aggregating?)... may be try this

TempOrders:
LOAD unit,
     Max(orderID) as [Max order],
     TimeStamp(Max("OrderDate")) as [Max order date]
Resident Orders
Where Product = 'This'
Group By unit;