Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Sv translation
languageen

It happens very frequently that we use a few drill downs in our tables, and we want to calculate the average of indicators at different levels.

Note

It is recommended to get familiar with memberValue and crossValue functions before proceeding with this tutorial.

In the table below, you can see two drill down levels (Employee Name and Product). Avg. Rating is calculating the average rating for that employee on that product.

ilupng
Avg_1

But you may want to compare the employee's average rating for a product with the overall employee rating for the same product as a benchmark, as it is shown in the Avg. Benchmark column. This could be added as a conditional formatting, so if the employee's avg. rating on a product is higher than overall employee's rating on this product, we can mark it as green and show an upper arrow there.

Here is how you could calculate this.

Code Block
if(!equals(substringBefore(memberValue(), ' ') ,'Product')) { 
  return ''; 
} else { 
  filter("L_PRODUCT in ('" + memberValue() + "')") {crossValue('CUBE_DAILY_CALLS.DAILY_CALLS','M_RATING@AVG')}; 
}
Note

It is recommended to get familiar with crossValue formula before proceeding with this tutorial. As crossValue will not take drill downs applied in the context view.

In this table below, now Product is being placed as the first level of drill downs, and then Employee Name is the second level. Avg. Benchmark is still the overall employee average on the product. Changing the order of the drill downs will make calculating *Avg. Benchmark" a little bit different.

ilupng
Avg_2

The code is as below:

Code Block
double benchmark = 0; 
if(equals(substringBefore(memberValue(), ' '), 'Product') 
   || isBlank(memberValue())) { 
  benchmark = M_RATING@AVG; 
}else { 
  benchmark = prev('M_RATING@AVG',1); 
} 

return benchmark

Next Steps

List siblings
Sv translation
languageja

表でいくつかのドリルダウンを使用することは非常に頻繁に発生し、様々なレベルでインジケータの平均を計算したい場合があります。

Note

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

次の表では、2つのドリルダウンレベル(従業員名製品)を確認できます。Avg. Ratingは、その製品に対するその従業員の平均評価を計算することです。

ilupng
Avg_1
ただし、Avg.Benchmark列に示されているように、製品の従業員の平均評価を、ベンチマークと同じ製品の従業員全体の評価と比較することもできます。これは条件付き書式として追加できるため、その製品の従業員の平均レートが、同製品の従業員全体のレートよりも高い場合、緑色でマークし、上向き矢印で表示できます。

これを計算する方法は次の通りです。

Code Block
if(!equals(substringBefore(memberValue(), ' ') ,'Product')) { 
  return ''; 
} else { 
  filter("L_PRODUCT in ('" + memberValue() + "')") {crossValue('CUBE_DAILY_CALLS.DAILY_CALLS','M_RATING@AVG')}; 
}
Note

このチュートリアルに進む前に、crossValue数式を十分参照することをお勧めします。crossValueは、コンテキストビューで適用されるドリルダウンを取得しません。

以下の表では、製品がドリルダウンの最初のレベルとして配置され、従業員名が2番目のレベルになります。 Avg. Benchmarkは、依然として製品の従業員全体の平均です。ドリルダウンの順序を変更すると、Avg. Benchmarkの計算が少し異なります。

ilupng
Avg_2
コードは以下の通りです:

Code Block
double benchmark = 0; 
if(equals(substringBefore(memberValue(), ' '), 'Product') 
   || isBlank(memberValue())) { 
  benchmark = M_RATING@AVG; 
}else { 
  benchmark = prev('M_RATING@AVG',1); 
} 

return benchmark

次に

List siblings

Sv translation
languagede

Es kommt sehr häufig vor, dass wir in unseren Tabellen ein paar Drill-Downs verwenden, und wir wollen den Durchschnitt der Indikatoren auf verschiedenen Ebenen berechnen.

Note

Es wird empfohlen, sich mit den Funktionen memberValue und crossValue vertraut zu machen, bevor Sie mit diesem Tutorial fortfahren.

In der folgenden Tabelle sehen Sie zwei Drill-down-Ebenen () (Mitarbeitername und Produkt). Das durchschnittliche Rating berechnet die durchschnittliche Bewertung für diesen Mitarbeiter für dieses Produkt.

ilupng
Avg_1
Sie können jedoch die durchschnittliche Bewertung des Mitarbeiters für ein Produkt mit der gesamten Mitarbeiterbewertung für das gleiche Produkt als Benchmark vergleichen, wie sie im Avg. Benchmark-Spalte. Dies könnte als bedingte Formatierung hinzugefügt werden, so dass wir, wenn die durchschnittliche Bewertung des Mitarbeiters für ein Produkt höher ist als die gesamte Bewertung des Mitarbeiters für dieses Produkt, es als grün markieren und dort einen oberen Pfeil anzeigen können.

Hier ist, wie Sie dies berechnen können.

Code Block
if(!equals(substringBefore(memberValue(), ' ') ,'Product')) { 
  return ''; 
} else { 
  filter("L_PRODUCT in ('" + memberValue() + "')") {crossValue('CUBE_DAILY_CALLS.DAILY_CALLS','M_RATING@AVG')}; 
}
Note

Es wird empfohlen, sich mit der crossValue-Formel vertraut zu machen, bevor Sie mit diesem Tutorial fortfahren. Da crossValue keine Drill-Downs in der Kontextansicht durchführt.

In dieser Tabelle unten wird nun das Produkt als erste Ebene der Drill-Downs platziert, und dann ist der Mitarbeitername die zweite Ebene. Durchschnittlicher Benchmark ist immer noch der gesamte Mitarbeiterdurchschnitt am Produkt. Wenn Sie die Reihenfolge der Drill-Downs ändern, wird die Berechnung von *Avg. Benchmark" etwas anders.

ilupng
Avg_2
Der Code ist wie folgt:

Code Block
double benchmark = 0; 
if(equals(substringBefore(memberValue(), ' '), 'Product') 
   || isBlank(memberValue())) { 
  benchmark = M_RATING@AVG; 
}else { 
  benchmark = prev('M_RATING@AVG',1); 
} 

return benchmark

Nächste Schritte

List siblings