This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async testFunction(payload) { | |
try { | |
const response = await this.$axios.put("url/to/update/resoure", payload); | |
// At this point, the response is the updated resoure | |
// as all the polling has been taken care of | |
alert(response); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function ({ $axios }) { | |
// Axios interceptor to handle responses that need to be polled | |
$axios.onResponse(async response => { | |
// Use the 202 response code as an indicator that polling is needed | |
if (response.status === 202) { | |
console.log("HTTP 202 received, polling operation..."); | |
console.log("Operation running at " + response.headers.location); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EVALUATE( | |
SUMMARIZECOLUMNS ( | |
'Date'[Day], | |
FILTER(Date, 'Date'[Year] = 2020), | |
"Order count", 'Measures'[CountOfOrders], | |
"Total amount", 'Measures'[TotalAmount], | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Weekly sales | |
In order understand if we're meeting our sales targets | |
As a sales manager | |
I need to see weekly sales figures for the year to date | |
Background: | |
Given I am logged in as 'Sales Manager' | |
And I am viewing the 'Weekly Sales' report | |
And there is the following 'Orders' data: | |
| OrderId | CustomerId | OrderDate | TotalAmount | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Orders entity | |
In order build reports that contain data about Orders | |
As a report designer | |
I want the Orders entity to be present in a dataflow | |
Background: | |
Given I have a dataflow called 'Sales Dataflow' | |
Scenario: Valdiate Orders entity schema | |
When I query the dataflow definition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AnalysisServices.Tabular; | |
public async Task AddOrUpdateCalculatedColumnAsync(string tableName, string columnName, string expression) | |
{ | |
using (var server = new Server()) | |
{ | |
server.Connect(this.GetConnectionString(await this.GetTokenAsync())); | |
var db = server.Databases[this.modelName]; | |
var model = db.Model; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<string> GetRefreshStatus(string id) | |
{ | |
var client = await this.AuthenticateAndUseHttpClient(); | |
var response = await client.GetAsync($"refreshes/{id}"); | |
response.EnsureSuccessStatusCode(); | |
var content = await response.Content.ReadAsStringAsync(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<string> RefreshModelAsync() | |
{ | |
var client = await this.AuthenticateAndUseHttpClient(); | |
// Hard coded to sensible defaults, but could be parameterised | |
var jsonBody = @"{""Type"": ""Automatic"",""CommitMode"": ""default"",""MaxParallelism"": 10}"; | |
var content = new StringContent(jsonBody, Encoding.UTF8, "application/json"); | |
var response = await client.PostAsync("refreshes", content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AnalysisServices.AdomdClient; | |
public async Task<List<string>> GetMeasuresAsync() | |
{ | |
var measureNames = new List<string>(); | |
using (var connection = new AdomdConnection(this.GetConnectionString(await this.GetTokenAsync()))) | |
{ | |
connection.Open(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async void CalcualteTotalSalesByCategory(int year) | |
{ | |
string query = $@"EVALUATE( | |
SUMMARIZECOLUMNS( | |
'DimProducts'[Category], | |
FILTER(DimDate, DimDate[Year] = {year}), | |
""Total Sales"", [TotalSales] | |
) | |
)"; |
NewerOlder