I've created a table of test results using stats list() to create a table that looks like this (the application name is only listed once against the group of tests it's related to):
Application | TestName | Outcome |
Website | Search One | Passed |
Contact Page | Passed | |
Order Form | Passed | |
Internal | Query Form | Passed |
Look Up | Passed |
I would like to amend the table so that the Application is shown in the 'TestName' column above the group of tests it's related to, so it looks like this:
TestName | Outcome |
Website | |
Search One | Passed |
Contact Page | Passed |
Order Form | Passed |
Internal | |
Query Form | Passed |
Look Up | Passed |
I know this breaks normal table data layout but for the purposes of my dashboard I think it will make it look more readable.
This kind of summarisation where you insert extra rows for summary is done using appendpipe
The logic here with streamstats is to enable the sort to order the rows as needed. This one here will preserve your existing order, but if you want to sort by TestName then you add TestName to the sort.
| streamstats c
| appendpipe [
stats values(Application) as TestName min(c) as mc by Application
| eval c=mc-.5
]
| sort c
| fields - Application c mc
Using streamstats to ensure correct ordering is dependent on the initial order of the data, so this will work with your example
This kind of summarisation where you insert extra rows for summary is done using appendpipe
The logic here with streamstats is to enable the sort to order the rows as needed. This one here will preserve your existing order, but if you want to sort by TestName then you add TestName to the sort.
| streamstats c
| appendpipe [
stats values(Application) as TestName min(c) as mc by Application
| eval c=mc-.5
]
| sort c
| fields - Application c mc
Using streamstats to ensure correct ordering is dependent on the initial order of the data, so this will work with your example