Hi,
Does anyone know how I can add a calculated column to solr reports?
Thanks,
Raluca
Hi,
Does anyone know how I can add a calculated column to solr reports?
Thanks,
Raluca
Hi Raluca,
Calculated columns are added to SearchIndex reports the same way they're added to SQL-based reports, but the difference is that you have to use Solr syntax.
First, you have to know what are the names of fields in Solr collections. You can check it by querying BPS_Elements collection in Solr admin page (example: instance creation date in SQL is stored in "WFD_TSInsert" column, but in Solr it is stored in "TS_Insert" field. There are other differences).
Then, to compare values and use conditions, you have to use Solr functions based on https://solr.apache.org/guide/solr/latest/query-guide/function-queries.html
I've attached screenshots with an example of an indicator that shows if an instance was modified in 2025.
It calculates a difference between TS_Insert and 2025-01-01 00:00:00, checks if the value is less or equal to 0, then returns "2" if statement if true or "0" if it's not.
It is a silly example to show the syntax.
Kind regards
Hi Raluca,
Calculated columns are added to SearchIndex reports the same way they're added to SQL-based reports, but the difference is that you have to use Solr syntax.
First, you have to know what are the names of fields in Solr collections. You can check it by querying BPS_Elements collection in Solr admin page (example: instance creation date in SQL is stored in "WFD_TSInsert" column, but in Solr it is stored in "TS_Insert" field. There are other differences).
Then, to compare values and use conditions, you have to use Solr functions based on https://solr.apache.org/guide/solr/latest/query-guide/function-queries.html
I've attached screenshots with an example of an indicator that shows if an instance was modified in 2025.
It calculates a difference between TS_Insert and 2025-01-01 00:00:00, checks if the value is less or equal to 0, then returns "2" if statement if true or "0" if it's not.
It is a silly example to show the syntax.
Kind regards
AND how does this relate to item list columns? how do you bite it?
AND how does this relate to item list columns? how do you bite it?
Lack of item lists is one of the known limitations of SearchIndex reports.
I've tried to fetch it using a calculated column (the Solr field name is "SUBS__{id}_SubElems"), but I failed because of the way it is stored in a collection.
I'm not sure whether this is possible at all in the current state.
Lack of item lists is one of the known limitations of SearchIndex reports.
I've tried to fetch it using a calculated column (the Solr field name is "SUBS__{id}_SubElems"), but I failed because of the way it is stored in a collection.
I'm not sure whether this is possible at all in the current state.
Hi Konrad,
can you elaborate on which other known limitations there are?
One obvious one would be that it may take (a little) time until an updated workflow instance has been processed in the queue.
Item lists are a second one.
A third one would (probably) be, that we can only fields of the current workflow instance.
Thanks for providing the link to the query functions. I will have to take a look at those. :)
Best regards,
Daniel