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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Invalid Expression error

any ideas why im getting an error? syntax looks ok to me... thanks

Expected:
NOCONCATENATE LOAD
order_no as po_no,
min(expected_date) as min_expected_date,
if(max_date_received > expected_date, inv_order_no) as lateOrders
RESIDENT opdetm
GROUP BY order_no;

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   You missed one more field in group by condition.

   Try this.

   

Expected:

NOCONCATENATE LOAD

order_no as po_no,

min(expected_date) as min_expected_date,

if(max_date_received > expected_date, inv_order_no) as lateOrders

RESIDENT opdetm

GROUP BY order_no,if(max_date_received > expected_date, inv_order_no);

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

2 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   You missed one more field in group by condition.

   Try this.

   

Expected:

NOCONCATENATE LOAD

order_no as po_no,

min(expected_date) as min_expected_date,

if(max_date_received > expected_date, inv_order_no) as lateOrders

RESIDENT opdetm

GROUP BY order_no,if(max_date_received > expected_date, inv_order_no);

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
pat_agen
Specialist
Specialist

hi,

you are using a group by command so any fields not referred to in the group by area will have to have an aggregation function.

min(expected_date) is ok but the following line wont work as neither max_date_recieved nor expected_date have an aggregation function.

your query is basically bringing back one line per order_no but it would appear that you would want one line per lateOrder is that right?