If I noticed and solved it by adding to the query :
query="SELECT count(*) as y, ESTADO as e FROM "vdf-procesos-tareas" WHERE ESTACION = 'IMS' ESTADO != 'COMPLETE' GROUP BY ESTADO"
`
But of course, it only worked for me when the first row was in compliance with the clause. Thanks to your answer I have read the documentation better and understood. Now, by sorting the results alphabetically (they can only be Complete, Suspended or Waiting) you can assign get cell the row to make the comparison.
filters
| essql
query="SELECT count(*) as y, ESTADO as e FROM \"vdf-procesos-tareas\" WHERE ESTACION = 'IMS' ESTADO != 'COMPLETE' GROUP BY ESTADO"
|image mode="contain" dataurl={switch
case={case if={all {getCell c="y" r=1| compare "eq" to=2} {getCell c= "e" r = 1 | compare eq to="WAITING"}} then= {asset asset-28b6df7f-49d1-4f82-ab86-4f4d15b613e8}}
case={case if={all {getCell c="y" r=1 | compare "gte" to =3} {getCell c= "e" r=1| compare eq to="WAITING"}} then= {asset asset-e39d55b1-0e1b-4b13-a29e-691337a08670}}
case={case if={all {getCell c="y" r=2 | compare "gte" to =2} {getCell c="e" r=2 | compare eq to="SUSPENDED"}} then= {asset asset-eb300919-21e1-438b-a66a-f2ebf485675d}}
default= {asset asset-9691b2ce-eeda-4b3b-b89d-13a1a0680768}
}
| render
But what do I do when only a value or two comes up? The order would not correspond... can get cell solve this case similar with one loop?
What is the end result that you are trying to achieve? If you are looking for an image per status, then you would need to break it up into separate elements for each potential status. So you would have one for "SUSPENDED" and one for "COMPLETE", etc.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.