Dashboards & Visualizations

Max from statistical chart

vivekkumark
New Member

I have created a chart with the below query

| chart max(PEAK) as Used max(Available) as "Qty" max(MaxUnused) as "Unused" over NAME by Month

And my result is as below

NAME Qty::Apr Qty::May Qty::Jun Unused::Apr Unused::May Unused::Jun Used::Apr Used::May Used::Jun
Test 10 10 20 1 2 3 9 8 12

I need additional 3 columns based on the above result to show Max Qty (Apr,May,Jun) and Max Used (Apr,May,Jun) and Min Unused (Apr,May,Jun)

Thanks.

Tags (1)
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try like this (Use some very high number for | eval MinUnused=1000000 if current value is not sufficient)

your search | chart max(PEAK) as Used max(Available) as "Qty" max(MaxUnused) as "Unused" over NAME by Month
| eval MaxQty=0 | eval MaxUsed=0 | eval MinUnused=1000000
| foreach Qty* [eval MaxQty=max('<<FIELD>>',MaxQty)]
| foreach Used* [eval MaxUsed=max('<<FIELD>>',MaxUsed)]
| foreach Unused* [eval MinUnused=min('<<FIELD>>',MinUnused)]

View solution in original post

vivekkumark
New Member

Awesome!!

Later found that we can also used if condition

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Try like this (Use some very high number for | eval MinUnused=1000000 if current value is not sufficient)

your search | chart max(PEAK) as Used max(Available) as "Qty" max(MaxUnused) as "Unused" over NAME by Month
| eval MaxQty=0 | eval MaxUsed=0 | eval MinUnused=1000000
| foreach Qty* [eval MaxQty=max('<<FIELD>>',MaxQty)]
| foreach Used* [eval MaxUsed=max('<<FIELD>>',MaxUsed)]
| foreach Unused* [eval MinUnused=min('<<FIELD>>',MinUnused)]
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...