Hi All
I have a csv file in splunk that i am searching on
i am looking to get the total monthly figure spend on each account number and then the total spend per month (of all account number)
...
See more...
Hi All
I have a csv file in splunk that i am searching on
i am looking to get the total monthly figure spend on each account number and then the total spend per month (of all account number)
Here my query i've created
..... main search | rename Order_Date as Month | stats count by Account_Number, Total_Sum, Month | eventstats sum(Total_Sum) as Monthly_Total by Month | sort - Total_Sum | sort Account_Number | stats list(Account_Number) as Account_Number, list(Total_Sum) as Total_Sum, values(Monthly_Total) as Monthly_Total by Month
it looks good but then i noticed that i haven't added each Account_Number up per month (see table below as 6210 appears 3 times. Can anyone help?
Month Account_Number Total_Sum Monthly_Total
April
5751
5756
6201
6203
6205
6210
6210
6210
6340
1986
23423.42
139
17003.09
7107.98
1395.12
50
18
8.05
51130.66
Also i'd like to make the figures in Euros
I've tried below but it wont work - any ideas | fieldformat Total="€".tostring(Total, "commas")
finally Splunk has put the month April at the top, i've tried to use the eval command to move January to the top using below code but this hasn't helped - any ideas?
| eval M=case(Month=="April","04", Month=="January","01", Month=="February", "02", Month=="March","03", Month=="May", "05", Month=="June", "06", Month=="July","07", Month=="August","08", Month=="September", "09") | sort M | fields - M
Many thanks
P