很抱歉,此類問題可能已經在討論中提出過,但我找不到適合我需要的應用程序的解決方案。 “求和”、“計數”等搜索詞過於籠統,很難準確找到我想要做的事情的解決方案。
我想創建一個列,其中包含每個“列 2”的給定值出現多少個“列 1”實例的公式
製表函數可以通過簡單地為給定的“週”列聲明“N”來非常容易地做到這一點,但我需要它成為應用程序的列公式。
我創建了一個包含蘋果、橙子和香蕉的示例表來進行演示。 我需要第三列“本週該水果的實例”的公式來列出給定“週”的“每日水果”實例的數量。 例如,“每周水果實例”列將列出 [5,2,5,5,5,5,2...] 因為 Apple 在 Week=1 中出現了 5 次,而 Banana 在 Week=1 中出現了 2 次。
感謝 JMP 社區對這款出色軟件的持續支持。
New Table( "Fruit Table",
Add Rows( 28 ),
New Column( "Fruit of the Day",
Character( 8 ),
"Nominal",
Set Values(
{"Apple", "Banana", "Apple", "Apple", "Apple", "Apple", "Banana",
"Orange", "Apple", "Banana", "Apple", "Banana", "Apple", "Apple",
"Apple", "Banana", "Apple", "Apple", "Apple", "Apple", "Banana", "Apple",
"Banana", "Apple", "Apple", "Apple", "Apple", "Banana"}
)
),
New Column( "Week",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values(
[1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
4, 4, 4, 4]
)
),
New Column( "Instances of this Fruit this Week",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., ., .,
., ., ., .]
)
)
)