Dashboard with custom timestamp not work properly
I want to create tile which show chart for for n th day from today's day.
On Query analyzer, it's working fine but when I pin that query as dashboard it show No data for the given query.
Sample query as below:
union (traces)
| where timestamp > ago(8d) and timestamp < ago(7d)
| extend itemType = iif(itemType == 'availabilityResult',itemType,iif(itemType == 'customEvent',itemType,iif(itemType == 'dependency',itemType,iif(itemType == 'pageView',itemType,iif(itemType == 'request',itemType,iif(itemType == 'trace',itemType,iif(itemType == 'exception',itemType,"")))))))
| where ((itemType == 'trace' or (itemType == 'request' or (itemType == 'pageView' or (itemType == 'customEvent' or (itemType == 'exception' or (itemType == 'dependency' or itemType == 'availabilityResult')))))))
| where message startswith 'Singlesearchresultcommon-RCOM'
| project timestamp, message = case(message startswith 'Singlesearchresultcommon-RCOM-true', 'R.com AVL', message startswith 'Singlesearchresult_common-RCOM-false', 'R.com NO AVL', 'unknown')
| summarize count() by message , bin(timestamp,1h)
| render timechart
I tried this below way also,
but it not work on dashboard.
let prevweekto = datetimeadd('week', -1, makedatetime(now()));
let prevweekfrom = datetimeadd('day', -1, prevweekto);
traces
| extend itemType = iif(itemType == 'availabilityResult',itemType,iif(itemType == 'customEvent',itemType,iif(itemType == 'dependency',itemType,iif(itemType == 'pageView',itemType,iif(itemType == 'request',itemType,iif(itemType == 'trace',itemType,iif(itemType == 'exception',itemType,"")))))))
| where timestamp between (prevweekfrom..prevweekto)
| where ((itemType == 'trace' or (itemType == 'request' or (itemType == 'pageView' or (itemType == 'customEvent' or (itemType == 'exception' or (itemType == 'dependency' or itemType == 'availabilityResult')))))))
| where message startswith 'Singlesearchresultcommon-RCOM'
| project timestamp, message = case(message startswith 'Singlesearchresultcommon-RCOM-true', 'R.com AVL', message startswith 'Singlesearchresultcommon-RCOM-false', 'R.com NO AVL', 'unknown')
| summarize count() by message , bin(timestamp,1h)
| render timechart;
Note: above query work fine in azure query but not work as expected on dashboard.
