Try this - replace your last chart statement with these two lines - the chart just is renaming the fields and the foreach is doing the calc, i.e. Ratio=TintCount/Zones
| chart sum(tint_count) as TintCount dc(zonename) as Zones by direction type
| foreach TintCount* [ eval "Ratio<<MATCHSTR>>"='<<FIELD>>'/'Zones<<MATCHSTR>>' ]
Can you provide the query you are using? What happens when you tried what you tried?
Just found I can directly add sum(___) and dc(___) inside chart command which solved my previous problem lol! Thanks for looking into it though. Now I have a follow up quesion about my post-analysis for adding calculated fileds into the same chart...
Try this - replace your last chart statement with these two lines - the chart just is renaming the fields and the foreach is doing the calc, i.e. Ratio=TintCount/Zones
| chart sum(tint_count) as TintCount dc(zonename) as Zones by direction type
| foreach TintCount* [ eval "Ratio<<MATCHSTR>>"='<<FIELD>>'/'Zones<<MATCHSTR>>' ]
Thanks for the suggestion! But it doesn't seem to work
Is the foreach command supposed to insert a new column called Ratio in this case?
Oops thanks @ITWhisperer pointing out the typo
dc(zonename) should be dc(zoneName)