Commits

Tim Hatch  committed a5685c2

Add examplefiles for GoodData

  • Participants
  • Parent commits 5169fd0

Comments (0)

Files changed (2)

File tests/examplefiles/test.gdc

+# Execute the date dimension MAQL script
+ExecuteMaql(maqlFile="examples/quotes/quote_date.maql");
+
+# load the stock quotes data file
+# the data file config has been generated
+LoadCsv(csvDataFile="examples/quotes/quotes.csv",
+	header="true",
+	configFile="examples/quotes/quotes.config.xml");
+
+# transfer the stock quotes data
+TransferLastSnapshot();
+
+LoadGoogleAnalytics(configFile="examples/ga/ga.config.xml",username="example@gmail.com",password="******",profileId="ga:7468896",dimensions="ga:date|ga:browser|ga:browserVersion|ga:country|ga:isMobile",metrics="ga:bounces|ga:newVisits|ga:pageViews|ga:visits",startDate="2008-01-01",endDate="2010-06-15");

File tests/examplefiles/test.maql

+# MAQL script
+CREATE DATASET {dataset.quotes} VISUAL(TITLE "St\\tock Qu\totes Data");
+
+# A comment
+CREATE DATASET {dataset.quotes} VISUAL(TITLE "Stock Qu\"otes Data");
+
+CREATE DATASET {dataset.quotes} VISUAL(TITLE "Stock Quotes Data");
+
+ALTER DATASET {dataset.quotes} ADD {attribute.sector};
+
+ALTER DATASET {dataset.quotes} DROP {attribute.symbol};
+
+ALTER DATASET {dataset.quotes} VISUAL(TITLE "Internal Quotes Data");
+
+CREATE ATTRIBUTE {attr.quotes.symbol}
+    VISUAL(TITLE "Symbol", FOLDER {folder.quotes.attr})
+    AS {d_quotes_symbol.nm_symbol};
+
+ALTER ATTRIBUTE {attr.quotes.symbol}
+    ADD LABELS {attr.quotes.company} VISUAL(TITLE "Company")
+    AS {d_quotes_symbol.nm_company};
+
+CREATE FACT {fact.quotes.open_price}
+    VISUAL( TITLE "Open Price", FOLDER {folder.quotes.fact}) AS {f_quotes.f_open_price};
+
+ALTER FACT {fact.quotes.open_price} ADD {f_quotes2.f_open_price};
+
+CREATE FOLDER {folder.quotes.attr}
+    VISUAL ( TITLE "Stock Quotes Data",
+             DESCRIPTION "Stock quotes data obtained from John Doe etc." )
+    TYPE ATTRIBUTE;
+
+ALTER DATATYPE {d_quotes_symbol.nm_symbol} VARCHAR(4),
+    {d_quotes_symbol.nm_symbol} VARCHAR(80),
+    {f_quotes.f_open_price} DECIMAL(10,2);
+
+INCLUDE TEMPLATE "URN:GOODDATA:DATE" MODIFY (IDENTIFIER "my-date", TITLE "quote")
+
+ALTER ATTRIBUTE {attr.quotes.symbol} ADD KEYS {d_quotes_symbol.nm_symbol} PRIMARY;
+
+ALTER ATTRIBUTE {attr.quotes.symbol} DROP KEYS {d_quotes_symbol.nm_symbol};
+
+ALTER FACT {fact.quotes.open_price} ADD {f_quotes2.f_open_price};
+
+# Another comment