Ask about rollup

Hi everyone,

How can we count with a specified condition? I see in the rollup, there is only count without applying any condition there.

In my case, in a column, there are two kind of data written, which are “OK” and “Not OK”. How can I count the “Not OK” in that column?

In Excel, I would simply write this : =COUNTIF(A2:A1000,“Not OK”)

Thank you for your answer.

You can use a Query column and apply a filter, and then do a rollup through the query.

Alternatively, instead of using “OK” and “Not OK”, use a boolean column. Then you could do a direct rollup counting true values.

Hi @Darren_Murphy thanks for your answer.

I don’t understand this Query function. How can we show this Query in Layout Editor? For example, from all 5 registered farmers (counted by total row only), there are 4 that the data is not completed. I use Query and filter the condition, and I get this result :

But how can I bring this result to interface / layout?

Then you could do a direct rollup counting true values

This is conditional counting (count if true), I can’t do conditional counting in Glide Table.

and then do a rollup through the query.

There’s no Query column in the Rollup option.

I think I missed something but I am not sure.

@Darren_Murphy

I see.

Voila! This is cool…

Thanks a lot @Darren_Murphy !

1 Like

Hi @Darren_Murphy sorry I want to ask again,

Why is the field shown here is like this?

image

This “off farm” is not the thing I want to see here. I want to see “transaction_id” on the queried column.

Why is the third column shown in the query, not the first column?

The value that you see in the query bubble doesn’t mean anything, other than telling you that the query matched something. It works like a multiple relation in that respect.

If you need a specific value, you should add a Single Value column that fetches the value via the query (in this case, the transaction_id).

2 Likes