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」リストです。


コード
      AppleFruits
      OrangeFruits
      BananaFruits
   FruitsFresh produce
      CarrotVegetables
      BeetrootVegetables
      BroccoliVegetables
   VegetablesFresh produce
Fresh produce


AppleOrangeBananaFruitsCarrotBeetrootBroccoliVegetablesFresh produce

Product

ITEM(Products list)

AppleOrangeBanana
CarrotBeetrootBroccoli

Is Fruits parent?

ISANCESTOR(Products list.Fruits, Product)

true

true

true







Is Vegetables parent?

ISANCESTOR(Products list.Vegetables, Product)





true

true

true



Is Fresh produce parent?

ISANCESTOR(Products list.Fresh produce, Product)

true

true

true


true

true

true



最初のライン アイテム「Product」は「Products」リスト内の各製品を返します。他の三つのライン アイテムでは ISANCESTOR() 式を使用して、これらの製品が「Fruits」、「Vegetables」、「Fresh products」のどれに属しているかを確認します。

こちらの例のモジュールでは、列に「Organization」リスト、行にライン アイテムがあります。

Organization」リストは階層リストで、企業のトップ レベルです。このリストでは、地域が国の親、国が都市の親となっています。

一つ目のライン アイテムである「City」では、ITEM 関数を使用して「Organization」リスト内のそれぞれの場所を返しています。残り三つのライン アイテムでは、ISANCESTOR 関数を使用して、UK、France、EMEA のうちどの地域に対象の都市があるかをチェックしています。


LondonBirminghamParisLyonNew YorkLos Angeles
CityLondonBirminghamParisLyonNew YorkLos Angeles

Part of UK?

ISANCESTOR(Organization.UK, City)

true

true





Part of France?

ISANCESTOR(Organization.France, City)



true

true



Part of EMEA?

ISANCESTOR(Organization.EMEA, City)

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 DatesExpiry Dates
Chosen MonthFeb 2022Jul 2022
Chosen QuarterQ1 FY22Q1 FY22

Quarter is Ancestor?

ISANCESTOR(Chosen Quarter, Chosen Month)

true


Chosen Month Within Q3 FY22?

ISANCESTOR(Time.'Q3 FY22', Chosen Month)


true