itshemant09
itshemant09

Reputation: 1

Print custom message when there is no data in table return by kusto query

I am working on a dashboard, where in backend Kusto query are running and plot a graph on dashboard based on the results.

I am trying to print a custom message like,

| extend CustomColumn=iff(isempty(expectedExpiration), 
  "Expiration data is not available for this ",expectedExpiration)

I tried isempty, isnull, isNaN function as well but I am not getting this custom message as an output.

Can someone help in finding what is going wrong here or I am missing something?

Upvotes: 0

Views: 264

Answers (1)

malvarez
malvarez

Reputation: 41

Are you able to provide more details one what you mean by not working? Is it failing? Is it ignoring your else or then? Just from looking at it, I would guess that you have conflicting data types. Assuming:

expectedExpiration: datetime
custom message: string

If that is the case, try to change expectedExpiration to a string and that should work. Again, you might give us more details so we can help you out.

| extend CustomColumn=iff(isempty(tostring(expectedExpiration)), 
  "Expiration data is not available for this ",tostring(expectedExpiration))

Upvotes: 0

Related Questions