Log Analytics query with pivot

%3CLINGO-SUB%20id%3D%22lingo-sub-147475%22%20slang%3D%22en-US%22%3ELog%20Analytics%20query%20with%20pivot%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-147475%22%20slang%3D%22en-US%22%3E%3CP%3Ei%20am%20trying%20to%20write%20a%20pivot%20query%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3Eapp(%22PaymentsAppInsights%22).customEvents%0A%7C%20where%20name%20%3D%3D%20%22PublishToTenantSuccess%22%0A%7C%20where%20customDimensions.%5B%22TenantName%22%5D%20%3D%3D%20%22UST%22%0A%7C%20project%20SourceTransactionId%20%3D%20tostring(customDimensions.%5B%22SourceTransactionId%22%5D)%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20StatusCode%20%20%20%20%20%20%20%20%20%20%3D%20tostring(customDimensions.%5B%22StatusCode%22%5D)%2C%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%20%20SapTimeStamp%20%20%20%20%20%20%20%20%3D%20todatetime(customDimensions.%5B%22SapTimeStamp%22%5D)%0A%7C%20where%20SapTimeStamp%20%26gt%3B%20ago(1d)%0A%7C%20order%20by%20SourceTransactionId%2C%20SapTimeStamp%20asc%0A%7C%20evaluate%20pivot(StatusCode)%3C%2FPRE%3E%0A%3CP%3Eand%20i%20am%20getting%20this%20error.%20what%20am%20i%20doing%20wrong%20here%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EOne%20or%20more%20pattern%20references%20were%20not%20declared.%20Detected%20pattern%20references%3A%20Support%20id%3A%206a44b86f-91c5-4aba-b163-1598a59cd314%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-147475%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-150533%22%20slang%3D%22en-US%22%3ERe%3A%20Log%20Analytics%20query%20with%20pivot%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-150533%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20able%20to%20reproduce%20it%20too%20with%20my%20query.%20It%20happens%20to%20me%20only%20when%20using%20app().%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20following%20produces%20the%20same%20error%3A%3C%2FP%3E%0A%3CPRE%3Eapp('MY_APP').customEvents%0A%7C%20where%20....%0A....%0A%7C%20evaluate%20pivot(name%2C%20sum(sum_dcount_user_Id))%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhile%2C%20this%20one%20works%20(when%20running%20in%20MY_APP)%3A%3C%2FP%3E%0A%3CPRE%3EcustomEvents%0A%7C%20where%20....%0A....%0A%7C%20evaluate%20pivot(name%2C%20sum(sum_dcount_user_Id))%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Microsoft

i am trying to write a pivot query 

app("PaymentsAppInsights").customEvents
| where name == "PublishToTenantSuccess"
| where customDimensions.["TenantName"] == "UST"
| project SourceTransactionId = tostring(customDimensions.["SourceTransactionId"]),                      
          StatusCode          = tostring(customDimensions.["StatusCode"]),                      
          SapTimeStamp        = todatetime(customDimensions.["SapTimeStamp"])
| where SapTimeStamp > ago(1d)
| order by SourceTransactionId, SapTimeStamp asc
| evaluate pivot(StatusCode)

and i am getting this error. what am i doing wrong here? 

One or more pattern references were not declared. Detected pattern references: Support id: 6a44b86f-91c5-4aba-b163-1598a59cd314

1 Reply
Highlighted

I was able to reproduce it too with my query. It happens to me only when using app().

 

The following produces the same error:

app('MY_APP').customEvents
| where ....
....
| evaluate pivot(name, sum(sum_dcount_user_Id))

 

While, this one works (when running in MY_APP):

customEvents
| where ....
....
| evaluate pivot(name, sum(sum_dcount_user_Id))