Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
(Vendor Invoice Value x 2.50)/100. This formula should be applied for the only following Storage Locations -IB01, IB04, IF01, IF02, IF04, IL01, IL02, IN01, IN02, IN04, ING1, IP01, IP04
PLS TELL ME EXPRESSION FOR THIS
if(index(StorageLocation,'IB01, IB04, IF01, IF02, IF04, IL01, IL02, IN01, IN02, IN04, ING1, IP01, IP04')>0,
(Vendor Invoice Value x 2.50)/100,
Vendor Invoice Value) as Whatever;
what is index here
Using Match(), like:
=Sum(If(Match(StorageLocation,'IB01', 'IB04','IF01', 'IF02', 'IF04', 'IL01', 'IL02', 'IN01', 'IN02', 'IN04', 'ING1', 'IP01', 'IP04') , Vendor [Invoice Value x 2.50] )/100)
Index is string function
From QV help
Position of a substring. This function gives the starting position of the n:th occurrence of substring s2 in string s1. If n is omitted, the first occurrence is assumed. If n is negative, the search is made starting from the end of string s1. The result is an integer. The positions in the string are numbered from 1 and up.
Your field StorageLocation should be second argument to Index function like below
if(index('IB01, IB04, IF01, IF02, IF04, IL01, IL02, IN01, IN02, IN04, ING1, IP01, IP04',StorageLocation)>0,
(Vendor Invoice Value x 2.50)/100,
Vendor Invoice Value) as Whatever;
Index can be used like this
index('IB01, IB04, IF01, IF02, IF04, IL01, IL02, IN01, IN02, IN04, ING1, IP01, IP04',StorageLocation)
HI
Try with Match function
=Sum(If(Match(StorageLocation,'IB01', 'IB04','IF01', 'IF02', 'IF04', 'IL01', 'IL02', 'IN01', 'IN02', 'IN04', 'ING1', 'IP01', 'IP04') ,
(Vendor [Invoice Value x 2.50] )/100, 0))
hope it helps