App Insights Query with where clause on timestamp yields different results for every run

Rohit V 6 Reputation points
2023-01-02T06:28:07.757+00:00

When I run the following query on app insights I get different results for every run

let allEvents=customEvents  
    | where timestamp between (datetime('2022-12-30')..datetime('2022-12-31'));  
allEvents  
| where name == "Event1"  
| project st1 = timestamp,user_Id  
| join kind=innerunique (  
    allEvents  
    | where name == "Event2"  
    | project st2= timestamp,user_Id  
    ) on user_Id  
| where st1 < st2  
| summarize count()  

I few further observations

  • If I remove the where clause, the results remain constant
  • If I use join kind = inner, the results remain constant
Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,666 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,977 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,651 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rohit V 6 Reputation points
    2023-01-02T06:32:37.287+00:00

    Closing this. Upon reading the documentation further, I guess by definition innerunique will pick a random row if there are multiple to use for the join. That explains it

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.