Hello community,
I’m trying to get, from each query I made, the highest between ERROR-WARN-INFO, information that comes from a request to an API in a json object property. I tried with different transformations, but as they are not numbers I can’t use the reduce one with “max” and I wasn’t able to convert them to numbers either. Also, I tried using simple jsonata in the row section but didn’t work… So up to now I have this:
I would like to have a merged table that says the highest valure for each frame.
Thank you very much!
Hello,
does the table have only one column “value”?
I tried a solution that seems to work:
Here I have the column “status”, that has the values “200, 404, …”.
- I added a new field with values 1 to all the the rows.
- I grouped by the column “status” to get the sum (total) of all those 1’s for each “status”.
-
- I ordered the values reversibly and then limit the rows by 1 to keep only the max.
- I added the “merge” transformation to combine the results from the 2 queries.
Thank you very much!
The thing is I need to keep the Highest status between ERROR-WARN-INFO (in that order) in each frame that I will merge then, not the one that appears the most. Perhaps I explained myself incorrectly. If I have, in one of the frames, 2 WARN and 3 INFO, I have to keep WARN, and if I have 3 INFO and 1 ERROR, i have to keep ERROR.
Even so I’ll see if I can take some ideas from what you did. Thank you!
So, here we have 1 ERROR 1 WARN 3 INFO; You want to keep only ERROR with the number? “Error 1”
Yes, if I have at least one ERROR value, I want to keep just ERROR in that frame, but if there is no ERROR and there is at least one WARN, I want to keep WARN, and so no. Like an If clause. Then merge the two frames and have the highest state for each query (because I did two queries):
Thank you for answering!!!