Hello everyone,
I am trying to SUM the columns.
index="nzc-neel-uttar" source="http:kyhkp"
| timechart span=1d count by Type
| eval "New_Date"=strftime(_time,"%Y-%m-%d")
_time | Type-A | Type-B | New_Date |
20/07/2023 | 3 | 8 | 20/07/2023 |
21/07/2023 | 4 | 23 |
21/07/2023 |
22/07/2023 | 66 | 0 | 22/07/2023 |
23/07/2023 | 90 | 0 | 23/07/2023 |
24/07/2023 | 0 | 6 | 24/07/2023 |
25/07/2023 | 0 | 23 | 25/07/2023 |
Desired Output:
New_Date | Type-A | Type-B | Total |
20/07/2023 | 3 | 8 | 11 |
21/07/2023 | 4 | 23 | 27 |
22/07/2023 | 66 | 0 | 66 |
23/07/2023 | 90 | 0 | 90 |
24/07/2023 | 0 | 6 | 6 |
25/07/2023 | 0 | 23 | 23 |
Please suggest
Thanks
index="nzc-neel-uttar" source="http:kyhkp"
| timechart span=1d count by Type
| addtotals row=t
| eval "New_Date"=strftime(_time,"%Y-%m-%d")
index="nzc-neel-uttar" source="http:kyhkp"
| timechart span=1d count by Type
| addtotals row=t
| eval "New_Date"=strftime(_time,"%Y-%m-%d")
Its working fine, thank you so much!
How to add others columns from the index? Ex: Phase from the same index.
New_Date | Type-A | Type-B | Total | Phase |
20/07/2023 | 3 | 8 | 11 | 1 |
21/07/2023 | 4 | 23 | 27 | 1 |
22/07/2023 | 66 | 0 | 66 | 1 |
23/07/2023 | 90 | 0 | 90 | 1 |
24/07/2023 | 0 | 6 | 6 | 1 |
25/07/2023 | 0 | 23 | 23 | abc |
Also, remove and rearrange the columns sequence, mentioned in the above table.
Unless Phase can be derived from your current results, you could potentially use appendcols, but it depends on your data.