Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can someone please tell me what's wrong with this piece of code
If([Item_POSNR]='CC0000',If([Package Type]='Charter',100,If([Package Type]='Scheduled',1,0)), // ERROR
If([Item_POSNR]='TI0000',100, // ERROR
Sum(If(Match([VBAP Material Group_MATKL],'01','60'),100,0)+ // ERROR
If(Match([VBAP Material Group_MATKL],'02','03','04','62','70'),1,0)))) as TypeSum // ERROR
Thanks!
This script looks correct to me. Do you still have issues with the script?
[Booking Item]:
LOAD * Inline [
Sales Document,VBAP Material Group_MATKL,VBAP Higher-level item_UEPOS
1,2,3 ];
[Booking Type]:
Load
[Sales Document],
Sum(If([VBAP Material Group_MATKL] = '10' and [VBAP Higher-level item_UEPOS] > '000000', 1, 0))
as [Room Nts],
Sum(If(match([VBAP Material Group_MATKL], '01', '60'), 100, 0)
+ If(match([VBAP Material Group_MATKL], '02', '03', '04', '62', '70'), 1, 0)) as TypeSum
Resident [Booking Item]
GROUP BY [Sales Document];
[Booking Type]:
Load
[Sales Document],
If([VBAP Material Group_MATKL] = '10' and [VBAP Higher-level item_UEPOS] > '000000', 1, 0)as [Room Nts],// there was no field on which you were summing so no sum aggregation required
If(match([VBAP Material Group_MATKL], '01', '60'), 100, 0)
+ If(match([VBAP Material Group_MATKL], '02', '03', '04', '62', '70'), 1, 0) as TypeSum
// there was no field on which you were summing so no sum aggregation required
Resident [Booking Item];
// you dont need Group by as though you say typesum but you are not adding fields you are adding static values which is not aggregation.
Left join ([Booking Header])
Load
[Sales Document],
[Room Nts],
If( TypeSum >= 100, 'Charter',
If(TypeSum >= 1, 'Scheduled', 'Land Only') ) as BkgType
Resident [Booking Type];
DROP Table [Booking Type];