startsWith 運算子拿來選擇資料錄要涵括在報表內、或者排除在報表外,非常實用。
使用方式
x startsWith y
{fieldname} startsWith "abc"
這個運算子可測試出 {Fieldname} 的內容開頭是不是指定的字元字串:"abc"。如果欄位的內容確實是以 "abc" 開頭,公式傳回 True 值;如果欄位的開頭是其他內容,則公式傳回 False。
範例
{customer.CUSTOMER NAME} startsWith "A"
TRUE,其中 {客戶.公司名稱} = ABC Ltd.
{customer.CUSTOMER NAME} startsWith "C"FALSE,其中 {客戶.公司名稱} = ABC Ltd.
{customer.CUSTOMER NAME} startsWith "ABC"TRUE,其中 {客戶.公司名稱} = ABC Inc. 或 ABC Ltd.
{customer.CUSTOMER NAME} startsWith "ABC"FALSE,其中 {客戶.公司名稱} = XYZ Inc.