0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

timeseries/fill/offset/sample

Last updated at Posted at 2021-03-25

目次

fill
offset
timeseries
sample

fill

データストリームに行を追加して、欠落している日付値を埋めます。

q = fill q by (dateCols=(Date_Year, Date_Quarter, "Y-Q"), partition='Type');

有効な日付指定

  • YearField, MonthField, "Y-M"
  • YearField, QuarterField, "Y-Q"
  • YearField, "Y"
  • YearField, WeekField "Y-W"
  • YearField, MonthField, DayField "Y-M-D"

offset

  • filter および order の順序は、入れ替えても結果は変わらないため、入れ替えることができます。
  • offset は、order より後に置く必要があります。
  • offset は limit より前に置く必要があります。
  • foreach ステートメントの後に置ける offset ステートメントは 1 つ以下です
q = order q by 'Account_Owner';
q = foreach q generate 'Account_Owner' as 'Account_Owner', 'Account_Type' as 'Account_Type', 'Amount' as 'Amount';
q = offset q 50;
q = limit q 50;

timeseries

既存のデータを使用して将来のデータポイントを予測します。timeseries を使用するには、Einstein Analytics Growth および Plus ライセンスが必要です。

来年訪問する旅行者の数はどの程度になるか?

  • foreachで値を出す
  • lengthは必須 
  • predictionInterval つまり信頼区間を指定します。使用できる値は 80 と 95 です。
  • dateCols使わん場合はorderは必須
  • seasonality  dateCols と一緒に使用
q = load "TouristData";
q = group q by ('Visit_Year', 'Visit_Month');
q = foreach q generate 'Visit_Year', 'Visit_Month', sum('NumTourist') as 'sum_NumTourist';

q = fill q by (dateCols=('Visit_Year','Visit_Month', "Y-M"));

q = timeseries q generate 'sum_NumTourist' as Tourists with (length=12, dateCols=('Visit_Year','Visit_Month', "Y-M"));
 
q = foreach q generate 'Visit_Year' + "~~~" + 'Visit_Month' as 'Visit_Year~~~Visit_Month', Tourists;

sample

このクエリは、各フェーズの商談数を返します。クエリで操作されるのはデータセットの 10% であるため、各フェーズでの数は、元の数の約 1/10 になります。

q = load "Opportunity" sample(10) repeatable(1);

スクリーンショット 2021-03-25 22.38.01.png

参考文献

Tableau CRM SAQL Reference (Tableau CRM SAQL リファレンス)』

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?