循环遍历FileMaker中的重复字段

时间:2012-04-02 15:52:03

标签: loops filemaker

注意:请不要评论您是否喜欢重复字段。这不是这个问题的重点。

有没有办法在FileMaker 10中简化此公式?

Substitute ( 
Trim ( 
Assortment Contents 3::Contents[1]   & ":" & Assortment Contents 3::Content Qty[1]   & ";" & 
Assortment Contents 3::Contents[2]   & ":" & Assortment Contents 3::Content Qty[2]   & ";" & 
Assortment Contents 3::Contents[3]   & ":" & Assortment Contents 3::Content Qty[3]   & ";" & 
Assortment Contents 3::Contents[4]   & ":" & Assortment Contents 3::Content Qty[4]   & ";" & 
Assortment Contents 3::Contents[5]   & ":" & Assortment Contents 3::Content Qty[5]   & ";" & 
Assortment Contents 3::Contents[6]   & ":" & Assortment Contents 3::Content Qty[6]   & ";" & 
Assortment Contents 3::Contents[7]   & ":" & Assortment Contents 3::Content Qty[7]   & ";" & 
Assortment Contents 3::Contents[8]   & ":" & Assortment Contents 3::Content Qty[8]   & ";" & 
Assortment Contents 3::Contents[9]   & ":" & Assortment Contents 3::Content Qty[9]   & ";" & 
Assortment Contents 3::Contents[10] & ":" & Assortment Contents 3::Content Qty[10] & ";" & 
Assortment Contents 3::Contents[11] & ":" & Assortment Contents 3::Content Qty[11] & ";" & 
Assortment Contents 3::Contents[12] & ":" & Assortment Contents 3::Content Qty[12] & ";" & 
Assortment Contents 3::Contents[13] & ":" & Assortment Contents 3::Content Qty[13] & ";" & 
Assortment Contents 3::Contents[14] & ":" & Assortment Contents 3::Content Qty[14] & ";" & 
Assortment Contents 3::Contents[15] & ":" & Assortment Contents 3::Content Qty[15] & ";" & 
Assortment Contents 3::Contents[16] & ":" & Assortment Contents 3::Content Qty[16] & ";" & 
Assortment Contents 3::Contents[17] & ":" & Assortment Contents 3::Content Qty[17] & ";" & 
Assortment Contents 3::Contents[18] & ":" & Assortment Contents 3::Content Qty[18] & ";" & 
Assortment Contents 3::Contents[19] & ":" & Assortment Contents 3::Content Qty[19] & ";" & 
Assortment Contents 3::Contents[20] & ":" & Assortment Contents 3::Content Qty[20] & ";" & 
Assortment Contents 3::Contents[21] & ":" & Assortment Contents 3::Content Qty[21] & ";" & 
Assortment Contents 3::Contents[22] & ":" & Assortment Contents 3::Content Qty[22] & ";" & 
Assortment Contents 3::Contents[23] & ":" & Assortment Contents 3::Content Qty[23] & ";" & 
Assortment Contents 3::Contents[24] & ":" & Assortment Contents 3::Content Qty[24] & ";" & 
Assortment Contents 3::Contents[25] & ":" & Assortment Contents 3::Content Qty[25] & ";" & 
Assortment Contents 3::Contents[26] & ":" & Assortment Contents 3::Content Qty[26] & ";" & 
Assortment Contents 3::Contents[27] & ":" & Assortment Contents 3::Content Qty[27] & ";" & 
Assortment Contents 3::Contents[28] & ":" & Assortment Contents 3::Content Qty[28] & ";" & 
Assortment Contents 3::Contents[29] & ":" & Assortment Contents 3::Content Qty[29] & ";" & 
Assortment Contents 3::Contents[30] & ":" & Assortment Contents 3::Content Qty[30] & ";" & 
Assortment Contents 3::Contents[31] & ":" & Assortment Contents 3::Content Qty[31] & ";" & 
Assortment Contents 3::Contents[32] & ":" & Assortment Contents 3::Content Qty[32] & ";" & 
Assortment Contents 3::Contents[33] & ":" & Assortment Contents 3::Content Qty[33] & ";" & 
Assortment Contents 3::Contents[34] & ":" & Assortment Contents 3::Content Qty[34] & ";" & 
Assortment Contents 3::Contents[35] & ":" & Assortment Contents 3::Content Qty[35] & ";" & 
Assortment Contents 3::Contents[36] & ":" & Assortment Contents 3::Content Qty[36] & ";"
);
":;" ; "" )

并非每次重复都会填充内容,这就是为什么我使用替换来删除多余的标点符号。

1 个答案:

答案 0 :(得分:1)

首先创建一个重复的calc字段,让我们称之为Combined,这等于:

Assortment Contents 3::Contents & ":" & Assortment Contents 3::Content Qty

然后使用List函数将其作为以返回分隔的列表。之后,它只是一些文本清理:

Substitute( Substitute( Trim( List( Assortment Contents 3::Combined ) ); "¶"; ";" ); ":;"; "" )