I have some fields "Codes" "Count". In the "Codes" field i'll get multiple values and will count the values totally by using "dc(Codes) as Count". But i need the unique count of each code.
Codes Count 123 10 111 222 333 444 555
The above is showing us as total count of values, but i need the unique count of each values like
Codes Count 123 5 111 1 222 1 333 1 444 1 555 1
Please help on this. If you have any questions please post. Thanks in advance!!!
If there's an ID simply do it this way:
yoursearch | stats count by Codes, ID
If you want to display it exactly the way you mentioned above then this is probably closer:
yoursearch | stats count by Codes, ID | stats list(Codes) as Codes, list(count) as count by ID