UPDATE: Fix for dynamic
Base search |
| eval temp = case(
match(Type ,"A"), Data * -1, <== Suppose you want -A,-B,-C
match(Type ,"B"), Data * -1,
match(Type ,"C"), Data * -1,
match(Type ,"D"), 0, <= Remove unwanted data if any
1==1, Data
)
| appendpipe [stats sum(temp) as Data by Date | eval Type = "Others"] | eval Type = split(Type , ",") <== sums up temp and put it back to the correct Keys
| eval temp2 = case( <== Repeat for another variable
match(Type ,"A"), Data * 1,
match(Type ,"B"), Data * 1,
match(Type ,"C"), Data * 1,
match(Type ,"D"), 0,
1==1, Data
)
| appendpipe [stats sum(temp2) as Data by Date | eval Type = "Others"] | eval Type = split(Type , ",") <== sums up temp and put it back to the correct Keys
... View more