Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Can anyone tell me if there is anything wrong with this if condition
If(not exists(Key, AutoNumberHash256([Transaction Invoice Date]),'MMM-YYYY') , [Transaction SAP Account Id] , [RO Id] ,[Transaction Product Code])), ApplyMap('Monthly_Manual_Rebates',Date(MonthStart([Transaction Invoice Date]),'MMM-YYYY') & '|' & [Transaction PAS Account Id] & '|' & [RO Id] & '|' & [Transaction Product Code],0)) as [Transaction Manual Rebates],
I get an error
Script error: Error in expression:If exists takes 1-2 parameters
also if you look at ths if condition in the picture there is a red for one of the brackets indicating that it is confused
I assume this:
If(
not exists(Key, AutoNumberHash256(Date(Monthstart([Transaction Invoice Date]),'MMM-YYYY') , [Transaction SAP Account Id] , [RO Id] ,[Transaction Product Code])),
ApplyMap(
'Monthly_Manual_Rebates'
,Date(MonthStart([Transaction Invoice Date]),'MMM-YYYY') & '|' & [Transaction PAS Account Id] & '|' & [RO Id] & '|' & [Transaction Product Code]
,0)
)
as [Transaction Manual Rebates],
AFAIK exists/not exists only work with Where. What exactly are you trying to do? May be there is another way to do this?
Looks like you're missing a 'Date(' somewhere because I see a date format string without a date function
If(not exists(Key, AutoNumberHash256([Transaction Invoice Date]),'MMM-YYYY') , [Transaction SAP Account Id] , [RO Id] ,[Transaction Product Code])),
And check that all the parentheses match up.
I assume this:
If(
not exists(Key, AutoNumberHash256(Date(Monthstart([Transaction Invoice Date]),'MMM-YYYY') , [Transaction SAP Account Id] , [RO Id] ,[Transaction Product Code])),
ApplyMap(
'Monthly_Manual_Rebates'
,Date(MonthStart([Transaction Invoice Date]),'MMM-YYYY') & '|' & [Transaction PAS Account Id] & '|' & [RO Id] & '|' & [Transaction Product Code]
,0)
)
as [Transaction Manual Rebates],
Thanks Stefan , I probably pasted my applymap incorrectly, so did it in steps, matched your response. thx again