Transpose rows to columns in splunk search - search

I have a table from a search query which has 5 rows and 1 column (known as host_type). I want to transpose the table in such a way so that I get 5 columns and 1 row. Any help will be appreciated.
This is the query I am using:
host_type=* sourcetype=* index=* xyz | fields host_type

The Splunk Transpose command may help:
transpose
Description
Returns the specified number of rows (search results) as columns (list of field values), such that each search row becomes a column.
Syntax
transpose [int] [column_name=<string>] [header_field=<field>] [include_empty=<bool>]
for more information on it check out:
http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Transpose

Related

split delimited row into multiple rows

I hope you can give me some guidance.
I have this first table with two comma delimited cells:
=>I separated the delimited values of the last column with power query. Split rows and remove the pivot (https://exceloffthegrid.com/power-query-split-delimited-cells-into-rows/):
=>My question is for the second column, how can I avoid that it generates the matrix product and only put a single value in the cell?
I want to get the table like this:
You could add 2 more steps:
Between first and second table above you may create and process a new column with combined values „d-1, e-2, f-3“ and “y-4, x-5” before unpivot.
After unpivot split the columns with the combined values to 2 columns back.

How to show columns that have more than x non empty rows

I have the following pivot table and I would like to see only the columns that have more than x non empty rows(months).
For example, I want to see only columns which have more than 4 non empty rows.
Hence, columns 70672, 1014006 and 1014015 should not be visible.
Is that possible?
Thanks in advance.
If you can add a helper column to your original data, you could do something like:
=COUNTIFS($C$2:$C$193,">0",$B$2:$B$193,B2)>4
And then use it as a filter in your pivot table:

Excel Index Matching between Value Range

I have a problem when trying to do index matching. I want to match the item from table 1 and table 2 to obtain the Sample field. If Item from table 1 is matched with table 2 Item and the Lot size from table 1 is in between table 2 LotSizeFrom and LotSizeTo. It will obtain the Sample field from table 2.
table 1
table 2
Expected Output
try the following formula. You will need to sort your data by item ascending and then by lot size from, also ascending. The column Lotsize to is not required. See the screenshot for the cell references.
=INDEX(INDEX($D$1:$D$19,MATCH(H2,$A$1:$A$19,0)):INDEX($D$1:$D$19,MATCH(H2,$A$1:$A$19,1)),MATCH(G2,INDEX($B$1:$B$19,MATCH(H2,$A$1:$A$19,0)):INDEX($B$1:$B$19,MATCH(H2,$A$1:$A$19,1)),1))
INDEX() combined with SUMPRODUCT() should work :
=INDEX($I$2:$I$18,SUMPRODUCT(ROW($F$2:$F$18)-1,($F$2:$F$18=B7)*(A7>=$G$2:$G$18)*(A7<$H$2:$H$18)))

How to add groups based on conditions in Excel?

I have a large set of data where I need to calculate the sum of groups for specific columns in a table. Here is an example of the table:
I need to sum up column H for each date group (column A) such that it will keep display this sum on the last row of the group. In other words, on the first group that we can visibly see here for 3/21/13, we would sum up 38 + 2 + 21 and display 61 to the right of cell H4930. This would be repeated throughout the data so as to display the sum of each group's H column entries at the lowest item in the group as aforenoted.
I am assuming that some VBA will be required here, but I am not sure how to attack this. How would this be done?
Yes as suggested by Idevelop ..you can get this done using pivot table
Select all the data -> goto Insert menu ->Pivot table > say ok
in Row field >Place A column title
in values field >place H column title
that's it
Let me know if you need more details.
Image :
I added 2 working columns before your Sum column.
Add: =NOT(ISNA(MATCH(C2,$Q$2:$Q$3,0))) to column N, where the Q2:Q3 are the numbers you wanted to check. Can be hidden.
Add: =IF(N2,COUNTIFS(A3:$A$7416,A2,N3:$N$7416,TRUE)=0,"") to column O. Can be hidden.
Add: =IF(AND(N2,O2),SUMIFS(H2:$H$2,A2:$A$2,A2,N2:$N$2,TRUE),"") to column P. This is your sum.
If you don't actually need to display all the data like this then a pivot table would be a lot clearer. You can filter based on numbers and so on easily.
edit: edited to check for specific codes in column C, per comment.
edit2: completely changed per comment. Requiring it to be inline with the last highlighted row is more complex.

removing some rows based on criteria - solving this by pivot tables

i have an excel data . the 3rd collumn contains phone numbers . i have to delete rows whose phone numbers have less than 10 digits . as the data is very large and not even one mistake is acceptable. i want to use pivot tables or automation script. pivot tables is better because the number of digits is variable and the collumn number is variable.
where im stuck. - whenever i use pivot tables to do this the original tabular format is lost . i get some cross tabular format which i dont want. here is the sample data.
date time number count
1-Sep-09 15:29:44 9800000005 1
2-Sep-09 10:07:03 333333 1
3-Sep-09 9:53:46 9800000004 1
7-Sep-09 14:47:31 9800000005 1
10-Sep-09 10:51:39 9800000001 1
12-Sep-09 14:52:50 9800000002 1
13-Sep-09 8:28:28 333333 1
17-Sep-09 10:32:13 9800000001 1
18-Sep-09 9:01:42 9800000005 1
I don't think a cube or code is necessary.
Try adding a calculation to show the length of the phone number to cell E2 with the formula
=len(C2)
(assuming that number appears in C2) - then copy this formula down to the rest of column E.
You can then apply an auto-filter to the table, and use a custom filter on column E to show all rows where the length is greater than or equal to 10.

Resources