hi
I try to display percent in my bar chart like this but it doesnt works
| chart count as total over sig_application by sig_transaction
| eval total=0
| foreach count*
[ eval total=total + <<FIELD>>]
| foreach count*
[ eval <<FIELD>>=round((<<FIELD>>/total)*100,1)]
| fields - total
is anybody can help please?
Try something like this
| chart count as total over sig_application by sig_transaction
| rename * as count*
| rename countsig_transaction as sig_transaction
| addtotals fieldname=total count*
| foreach count*
[ eval <<FIELD>>=round((<<FIELD>>/total)*100,1)]
| fields - total
What fields do you get from
| chart count as total over sig_application by sig_transaction
what do you mean exactly?
What are the fields/column called?
Your foreach count* assumes that that they all start with count?
you are right
it's not the case...
it miss | rename * as count*
Try something like this
| chart count as total over sig_application by sig_transaction
| rename * as count*
| rename countsig_transaction as sig_transaction
| addtotals fieldname=total count*
| foreach count*
[ eval <<FIELD>>=round((<<FIELD>>/total)*100,1)]
| fields - total
thanks to your help but i think its not a good idea to use it because its not really explicit in my chart
So you also have a column called countsig_transaction?
I just have a column countsig_app