ISANCESTOR 関数は二つのリスト又は時間軸の値を取ります。一つ目が二つ目の先祖である場合に TRUE が返されます。先祖はアイテムの親、親の親というようになります。
構文
ISANCESTOR(Ancestor, Descendant)
引数
| 引数 | データ型 | 説明 |
| Ancestor | リスト、時間軸 | Descendant 引数の先祖であるかどうかをテストする値 |
| Descendant | リスト、時間軸 | Ancestor 引数の子孫であるかどうかをテストする値 |
ISANCESTOR 関数は結果をブール値で返します。
計算エンジンの機能の違い
Polaris では、トップ レベル アイテムがオーファン エンティティと結合されている場合、ISANCESTOR 関数で FALSE が返されます。
Classic エンジンでは TRUE が返されます。
例
親製品の特定
こちらの例のモジュールでは、列に「Products」リスト、行に次のライン アイテムがあります。
- Product: 「Products」リストのリストデータ型
- Is Fruits parent?: ブール値データ型
- Is Vegetables parent?: ブール値データ型
- Is Fresh produce parent?: ブール値データ型
「Products」リストは階層リストです。このリストでは、「Fresh produce」が「Fruits」と「Vegetables」の親です。
以下はグリッド ビューに表示されている「Products」リストです。
| 親 | コード | |
| Apple | Fruits | |
| Orange | Fruits | |
| Banana | Fruits | |
| Fruits | Fresh produce | |
| Carrot | Vegetables | |
| Beetroot | Vegetables | |
| Broccoli | Vegetables | |
| Vegetables | Fresh produce | |
| Fresh produce |
| Apple | Orange | Banana | Fruits | Carrot | Beetroot | Broccoli | Vegetables | Fresh produce | |
Product
| Apple | Orange | Banana | Carrot | Beetroot | Broccoli | |||
Is Fruits parent?
| true | true | true | ||||||
Is Vegetables parent?
| true | true | true | ||||||
Is Fresh produce parent?
| true | true | true | true | true | true |
最初のライン アイテム「Product」は「Products」リスト内の各製品を返します。他の三つのライン アイテムでは ISANCESTOR() 式を使用して、これらの製品が「Fruits」、「Vegetables」、「Fresh products」のどれに属しているかを確認します。
組織階層の特定
こちらの例のモジュールでは、列に「Organization」リスト、行にライン アイテムがあります。
「Organization」リストは階層リストで、企業のトップ レベルです。このリストでは、地域が国の親、国が都市の親となっています。
一つ目のライン アイテムである「City」では、ITEM 関数を使用して「Organization」リスト内のそれぞれの場所を返しています。残り三つのライン アイテムでは、ISANCESTOR 関数を使用して、UK、France、EMEA のうちどの地域に対象の都市があるかをチェックしています。
| London | Birmingham | Paris | Lyon | New York | Los Angeles | |
| City | London | Birmingham | Paris | Lyon | New York | Los Angeles |
Part of UK?
| true | true | ||||
Part of France?
| true | true | ||||
Part of EMEA?
| true | true | true | true |
時間軸の例
こちらの例では、列に「Dates」リスト、行にライン アイテムがあります。ライン アイテム「Chosen Month」と「Chosen Quarter」のデータ型は時間軸です。 「Quarter is Ancestor?」のデータ型はブール値で、ISANCESTOR 関数を使用しています。「Chosen Quarter」の値が「Chosen Month」の先祖である場合にブール値として TRUE が返されます。
最後のライン アイテムである「Within Q3?」では、「Q3 FY22」の時間軸への直接参照を使用して「Chosen Month」の先祖であるかどうかをチェックしています。
| Key Dates | Expiry Dates | |
| Chosen Month | Feb 2022 | Jul 2022 |
| Chosen Quarter | Q1 FY22 | Q1 FY22 |
Quarter is Ancestor?
| true | |
Chosen Month Within Q3 FY22?
| true |