Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

You can display the top/bottom member value as KPIs by using BellaDati formulas.

Note

It is recommended to get familiar with membersSum and memberValue function before proceeding with this tutorial.

Example:
If you want to display the name of the top city according to number of units sold, here is code you could use. Here we use membersSum to loop through each city for the total units.

Code Block
top = '';
topUnit = 0;

membersSum('[L_CITIES]') {
  if (M_UNIT>topUnit){
    topUnit = M_UNIT
    top = memberValue()
  }
}

return top;

You can also write the formula in this way:

Code Block
top = '';
topUnit = 0;

membersSum('[L_CITIES]') {
  topUnit = M_UNIT
}

membersSum('[L_CITIES]') {
  if (M_UNIT > topUnit){
    topUnit = M_UNIT
    top = memberValue()
  }
}

return top;

If you want to display the bottom city with least total units. Here it is:

Code Block
bottom = ''
bottomUnit = 0

membersSum('[L_CITIES]') {
  bottomUnit = M_UNIT
}

membersSum('[L_CITIES]') {
  if (M_UNIT < bottomUnit){
    bottomUnit = M_UNIT
    bottom = memberValue()
  }
}

return bottom;

Here is how the result will look like in the view:

Image Modified

Next Steps

List siblings

Sv translation
languageja

BellaDatiのフォーミュラを使って最大・最小メンバー値をKPIとして表示できます。

Note

このチュートリアルに進む前に、memberSum機能とmemberValue機能を十分参照することをお勧めします。

例:
1セットの売れた数によって上位の都市名を表示したい場合、このコードを使うことができます。ここではmembersSumを使い、合計セット数でそれぞれの都市を見ていきます。

Code Block
top = '';
topUnit = 0;

membersSum('[L_CITIES]') {
  if (M_UNIT>topUnit){
    topUnit = M_UNIT
    top = memberValue()
  }
}

return top;

以下のようにフォーミュラを書く事もできます。

Code Block
top = '';
topUnit = 0;

membersSum('[L_CITIES]') {
  topUnit = M_UNIT
}

membersSum('[L_CITIES]') {
  if (M_UNIT > topUnit){
    topUnit = M_UNIT
    top = memberValue()
  }
}

return top;

最小合計セット数の最下位の都市を表示したい場合は以下のようにできます:

Code Block
bottom = ''
bottomUnit = 0

membersSum('[L_CITIES]') {
  bottomUnit = M_UNIT
}

membersSum('[L_CITIES]') {
  if (M_UNIT < bottomUnit){
    bottomUnit = M_UNIT
    bottom = memberValue()
  }
}

return bottom;

ビューでは以下のような結果になります

Image Added

次に

List siblings