Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
OS92
Contributor II
Contributor II

Min() in Script

Hello, 

 

Why doesnt work? --> Min function

Fault: Invalid Expression

 

[TEMP3]:
Load
[key.Materialnr] as 'TEMP3.Matnr'
Resident MARC
WHERE [BIGruppe] = '4320'
;

Inner Join [TEMP3]:

[TEMP4]:

Load
[key.Materialnr] as 'TEMP3.Matnr',
Min(If(not IsNull([Liefertermin Planauftrag für TEMP]), [Liefertermin Planauftrag für TEMP])) als 'TEMP .nächsterLGN',
[offene Menge] as 'TEMP.oM'
Resident MSKU
;

 

 

 

Regards,

Oliver

Labels (1)
2 Replies
David_Friend
Support
Support

@OS92 recommend you post in English for the broadest possible help, thanks!

brunobertels
Master
Master

Hi 

You need a group by clause in your table [TEMP_4] : 

 

see example below 

Temp:

LOAD * inline [

Customer|Product|OrderNumber|UnitSales|CustomerID

Astrida|AA|1|10|1

Astrida|AA|7|18|1

Astrida|BB|4|9|1

Astrida|CC|6|2|1

Betacab|AA|5|4|2

Betacab|BB|2|5|2

Betacab|DD

Canutility|DD|3|8

Canutility|CC

] (delimiter is '|');

Min:

LOAD Customer, Min(UnitSales) as MyMin

Resident Temp

Group By Customer;

 

So it could be 

[TEMP4]:

Load
[key.Materialnr] as 'TEMP3.Matnr',
Min(If(not IsNull([Liefertermin Planauftrag für TEMP]), [Liefertermin Planauftrag für TEMP])) als 'TEMP .nächsterLGN',
[offene Menge] as 'TEMP.oM'
Resident MSKU group by [offene Menge], [key.Materialnr] 
;