Hello all ,
i have been using workbooks for soe time .
i have a query that return number of failed and success iteration per action ,
i want to see in the results 2 columns per type , but i cant manage to make it work .
my query is:
traces
| where * has "workflowid"
| where timestamp {TimeRange}
| extend ActivityType = tostring(customDimensions.ActivityType)
| extend message = tostring(message)
| where (message has "Status: Failed" or message has "Status: Successful") and message has "ActionType: WORKFLOW"
| extend FailedCount = case(message has "Status: Failed", 1, 0)
| extend SuccessfulCount = case(message has "Status: Successful", 1, 0)
| extend WorkflowType = tostring(customDimensions.WorkflowType)
| extend WorkflowId = tostring(customDimensions.WorkflowId)
| summarize FailedCount = sum(FailedCount), SuccessfulCount = sum(SuccessfulCount) by WorkflowType
| sort by WorkflowType
| render columnchart
with(
title="Workflow Distribution Results - Per WorkFlow Type",
xtitle= "WorkFlow Type",
ytitle= "Total")
this the table i have 1 column separated to 2 categories .

these are the query setting in the workbook (visualization : Bar chart Categorical)


When i change visualization to Unstacked this is the result i get :

when i try to run the query in log analytics :
// Workflow Distribution Results - Per WorkFlow Type //
let activityType = "WORKFLOW";
let activitySuccessfulStatus = "Successful";
let activityFailedStatus = "Failed";
let workflowId = "workflowid";
let titleName = "Workflow Distribution Results - Per WorkFlow Type";
let xtitle = "Workflow Type";
let ytitle = "Total";
union isfuzzy=true
traces
| where * has workflowId
| extend ActionType = tostring(customDimensions.ActionType)
| extend ActivityType = tostring(customDimensions.ActivityType)
| extend TemporalStatus = tostring(customDimensions.TemporalStatus)
| extend message = tostring(message)
| where ActionType == activityType and (TemporalStatus == activitySuccessfulStatus or TemporalStatus == activityFailedStatus)
| extend FailedCount = toint(TemporalStatus == activityFailedStatus)
| extend SuccessfulCount = toint(TemporalStatus == activitySuccessfulStatus)
| extend WorkflowType = tostring(customDimensions.WorkflowType)
| extend WorkflowId = tostring(customDimensions.WorkflowId)
| project WorkflowType, FailedCount, SuccessfulCount
| project-rename Failed = FailedCount
| project-rename Successful = SuccessfulCount
| sort by WorkflowType
| render columnchart kind=unstacked with(title = titleName, xtitle = xtitle, ytitle = ytitle)
// Workflow Distribution Results - Per WorkFlow Type //
let activityType = "WORKFLOW";
let activitySuccessfulStatus = "Successful";
let activityFailedStatus = "Failed";
let workflowId = "workflowid";
let titleName = "Workflow Distribution Results - Per WorkFlow Type";
let xtitle = "Workflow Type";
let ytitle = "Total";
union isfuzzy=true
traces
| where * has workflowId
| extend ActionType = tostring(customDimensions.ActionType)
| extend ActivityType = tostring(customDimensions.ActivityType)
| extend TemporalStatus = tostring(customDimensions.TemporalStatus)
| extend message = tostring(message)
| where ActionType == activityType and (TemporalStatus == activitySuccessfulStatus or TemporalStatus == activityFailedStatus)
| extend FailedCount = toint(TemporalStatus == activityFailedStatus)
| extend SuccessfulCount = toint(TemporalStatus == activitySuccessfulStatus)
| extend WorkflowType = tostring(customDimensions.WorkflowType)
| extend WorkflowId = tostring(customDimensions.WorkflowId)
| project WorkflowType, FailedCount, SuccessfulCount
| project-rename Failed = FailedCount
| project-rename Successful = SuccessfulCount
| sort by WorkflowType
| render columnchart kind=unstacked with(title = titleName, xtitle = xtitle, ytitle = ytitle
i need to change the char formatting manually to : unstacked column then i see this result :

you can see that in my query i have set :
render columnchart kind=unstacked
render columnchart kind=unstackedrender columnchart kind=unstacked
render columnchart kind=unstacked
i hope you can help me out ...
thank you
Oded Kessler