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
Note

Make sure to get familiar with BellaDati formulas before proceeding with this section.

There are cases that you want your chart x-axis to display number of days for a particular event, rather than the calendar date.

For example, if you are running a marketing campaign from 2013-08-01 to 2013-10-01, you want to display:

  • 2013-08-01 to be "Day 01"
  • 2012-08-02 to be "Day 02"
  • 2013-10-01 to be "Day 62" and so on.

This use case is going to show you how you could make it if you only have the date in your data set.

Preparing Data with Transformation script

Create a new attribute called campaign_day in the data set and apply transformation script as seen below:

 

Code Block
int days= daysBetween(rowDate(), date('2013-08-01')) + 1;

String campaign_days = days.toString();

if(length(campaign_days) == 1) {
  return '0' + campaign_days;
}else {
  return campaign_days;
}

This will return the number of days in terms of the campaign starting time in the format of 00 to 62.

Creating formula

At the report level, set the campaign_day as the drill down and calculate the indicator as seen below:

 

Code Block
dateInterval('2013-08-01', '2013-08-01' + ' + ' + memberValue() + 'd') { 
  crossValue('ALL_SMS_2_JOINED.ALL_SMS_2_JOINED', 'L_MSISDN_DCOUNT') 
}


Note

It is recommended that you get familiar with Datetime Functions.


Info
Remember that Cross-Reference does not take drill down into consideration, so you are able to calculate the cumulated value. Here is how you use cross reference magically!

 

Here is how it looks like in the chart:

Next Steps

Sv translation
languageja
Note

このセクションに進む前に、BellaDati数式を十分参照することをお勧めします。

グラフのX軸に、カレンダーの日付ではなく、特定のイベントの日数を表示する場合があります。

例えば、2013年8月1日から2013年10月1日までのマーケティングキャンペーンを実行している場合、以下を表示します:

  • 2013-08-01は「1日目」

  • 2012-08-02は「2日目」

  • 2013-10-01は「62日目」など

この使用例では、データセットに日付のみがある場合にどのように作成できるかを示します。

変換スクリプトを使用したデータの準備

 データセットにcampaign_dayという新しい属性を作成し、以下のように変換スクリプトを適用します:

Code Block
int days= daysBetween(rowDate(), date('2013-08-01')) + 1;

String campaign_days = days.toString();

if(length(campaign_days) == 1) {
  return '0' + campaign_days;
}else {
  return campaign_days;
}

これにより、キャンペーン開始時間に関する日数が00〜62の形式で返されます。

数式の作成

レポートレベルで、campaign_dayをドリルダウンとして設定し、以下に示すようにインジケータを計算します:

Code Block
dateInterval('2013-08-01', '2013-08-01' + ' + ' + memberValue() + 'd') { 
  crossValue('ALL_SMS_2_JOINED.ALL_SMS_2_JOINED', 'L_MSISDN_DCOUNT') 
}
Note

Datetime Functionsを十分参照することをお勧めします。

Info

相互参照ではドリルダウンが考慮されないため、累積値を計算できることに注意してください。相互参照を魔法のように使用する方法を次に示します。

グラフでは次のような見た目になります:

ilupng
campaign_day

次に

Sv translation
languagede
Note

 Machen Sie sich unbedingt mit den BellaDati-Formeln vertraut, bevor Sie mit diesem Abschnitt fortfahren.

Es gibt Fälle, in denen Sie möchten, dass Ihre Diagramm x-Achse die Anzahl der Tage für ein bestimmtes Ereignis und nicht das Kalenderdatum anzeigt.

Wenn Sie beispielsweise eine Marketingkampagne vom 01.08.2013 bis 01.10.2013 durchführen, möchten Sie diese anzeigen:

  • 2013-08-01 to be "Day 01"
  • 2012-08-02 to be "Day 02"
  • 2013-10-01 to be "Day 62" and so on.

Dieser Anwendungsfall wird Ihnen zeigen, wie Sie es schaffen können, wenn Sie nur das Datum in Ihrem Dataset haben.

Datenvorbereitung mit Transformationsskript

Erstellen Sie ein neues Attribut namens Kampagnentag im Dataset und wenden Sie das Transformationsskript wie unten gezeigt an:

Code Block
int days= daysBetween(rowDate(), date('2013-08-01')) + 1;

String campaign_days = days.toString();

if(length(campaign_days) == 1) {
  return '0' + campaign_days;
}else {
  return campaign_days;
}

Dadurch wird die Anzahl der Tage bezogen auf die Startzeit der Kampagne im Format 00 bis 62 zurückgegeben.

Formel erstellen

Setzen Sie auf Berichtsebene den Kampagnentag als Drill-Down und berechnen Sie das Kennzeichen wie unten gezeigt:

Code Block
dateInterval('2013-08-01', '2013-08-01' + ' + ' + memberValue() + 'd') { 
  crossValue('ALL_SMS_2_JOINED.ALL_SMS_2_JOINED', 'L_MSISDN_DCOUNT') 
}


Note

Es wird empfohlen, dass Sie sich mit folgenden Themen vertraut machen Datumszeit-Funktionen.


Info

Beachten Sie, dass Querverweise keinen Drill-Down berücksichtigen, so dass Sie den kumulierten Wert berechnen können. Hier ist, wie Sie den Querverweis magisch verwenden!

So sieht es im Diagramm aus:

ilupng
campaign_day

Nächste Schritte