Forum Discussion
nExoR
Jul 04, 2022Copper Contributor
conditional columns
if there a way to project/extend columns conditionally? scenario: i want to make a resource query by name, and show some additional information based on resource type. any hints?
nExoR
Jul 14, 2022Copper Contributor
thanks! i'm using similar logic now, i was hoping for some method to NOT have columns instead of having empty columns. this logic means, that for each object there will be multiple, unnecessary, empty columns for objects of a different type...
anyway - thx for confirming.
anyway - thx for confirming.
wernerzirkel
Jul 14, 2022Brass Contributor
this would simple replace "Heavy Rain" in the existing column EventType by the String "it pours".
StormEvents
| where State =="CALIFORNIA"
| distinct EventType, State
| extend EventType = iif(EventType =="Heavy Rain" and State =="CALIFORNIA", "it pours",EventType)
StormEvents
| where State =="CALIFORNIA"
| distinct EventType, State
| extend EventType = iif(EventType =="Heavy Rain" and State =="CALIFORNIA", "it pours",EventType)
- nExoRJul 14, 2022Copper Contributoryes, exactly - but the column name is static, non-meaningful.
i will need to better understand distinct https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/distinctoperator
thx for the hint