diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/examplefiles/test.gdc | 13 | ||||
-rw-r--r-- | tests/examplefiles/test.maql | 45 |
2 files changed, 58 insertions, 0 deletions
diff --git a/tests/examplefiles/test.gdc b/tests/examplefiles/test.gdc new file mode 100644 index 00000000..c7e36b81 --- /dev/null +++ b/tests/examplefiles/test.gdc @@ -0,0 +1,13 @@ +# 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"); diff --git a/tests/examplefiles/test.maql b/tests/examplefiles/test.maql new file mode 100644 index 00000000..a44935fd --- /dev/null +++ b/tests/examplefiles/test.maql @@ -0,0 +1,45 @@ +# 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 |