Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

invalid expression- why?


LOAD

max(num(id)),
orderdate,

applymap('MapOrderStatus', orderstatus, '-')  as orderstatus,
applymap('MapcheckProcess',checkprocess, '-') as checkprocess
statusdate,

lastupdate,

num(unitnumber) as unitnumber;


SQL SELECT "id",
"orderdate",
"orderstatus",
"checkprocess",
"statusdate",
concat(unit_place,unit_year,RIGHT(CONCAT('000000', unit_code),6)) as unitnumber,
"lastupdate"
FROM "public"."record_orders"
group by unitnumber,orderdate,id, orderstatus, checkprocess,statusdate,lastupdate;

 

 

Hello, the above is my script.

I just want to get one max(id) per unitnumber but neither groupping by unitnumber alone isn't possible as it seems, nor groupping by all of the above.

 

I could use your help!

 

Thank you in advance 🙂 ❤️

 

2 Replies
Highlighted
Specialist
Specialist

Re: invalid expression- why?

You group statement is for the SQL, not the Qlik load.  I think you need to add a group statement in the Qlik load.

 

LOAD

max(num(id)),
orderdate,

applymap('MapOrderStatus', orderstatus, '-')  as orderstatus,
applymap('MapcheckProcess',checkprocess, '-') as checkprocess
statusdate,

lastupdate,

num(unitnumber) as unitnumber

group by .....;

Highlighted
Specialist
Specialist

Re: invalid expression- why?

May be try

Source:
LOAD

Num(id) as id,
orderdate,

applymap('MapOrderStatus', orderstatus, '-')  as orderstatus,
applymap('MapcheckProcess',checkprocess, '-') as checkprocess
statusdate,

lastupdate,

num(unitnumber) as unitnumber;



SQL SELECT "id",
"orderdate",
"orderstatus",
"checkprocess",
"statusdate",
concat(unit_place,unit_year,RIGHT(CONCAT('000000', unit_code),6)) as unitnumber,
"lastupdate"
FROM "public"."record_orders"
group by unitnumber,orderdate,id, orderstatus, checkprocess,statusdate,lastupdate;
Left Join(Source)
 Load
Max(id) as Max_ID
Resident Source
;