Splunk Search

Chart Top Seller Between Three Regions Per Year

rfernandez2010
New Member

Hello I'm new to Splunk and I'm stuck trying to create what should be a simple table.

Basically, I have a database of all video games every made since 1980. I have each games European, Japanese and North American sales. I wanted to see how the sales in each nation region to the others per year.

index=vgsales
|chart sum(EU_Sales) as EUSALES sum(JP_Sales) as JPSALES sum(NA_Sales) as NASALES by year

alt text

I wanted to know if it is possible to isolate the top performing region per year. I've tried many times to do this but just can't figure it out. This would be extremely helpful as my classmate would also like to chart the top selling genre per year.

Thanks in advance for the help.

0 Karma
1 Solution

woodcock
Esteemed Legend

Try this:

index=vgsales
| eval date_year=strftime(_time, "%Y")
| stats sum(EU_Sales) AS EUSALES sum(JP_Sales) AS JPSALES sum(NA_Sales) AS NASALES BY date_year
| untable date_year country sales
| sort 0 - sales
| dedup date_year

View solution in original post

0 Karma

woodcock
Esteemed Legend

Try this:

index=vgsales
| eval date_year=strftime(_time, "%Y")
| stats sum(EU_Sales) AS EUSALES sum(JP_Sales) AS JPSALES sum(NA_Sales) AS NASALES BY date_year
| untable date_year country sales
| sort 0 - sales
| dedup date_year
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...