cancel
Showing results for 
Search instead for 
Did you mean: 

If value > 0, divide by value

Alexa_Muhs
Elite Collaborator
Elite Collaborator

I have a dashboard request from a client that has proposals that go through a workflow. They would like to see the amount of time in days spent in each queue as a column in a table. So the columns would be: Proposal ID, Proposal Title, Days in Q1, Days in Q2,...,Days in Q16.

The proposals have a MIKG on them that include "School". Most proposals only have 1 school, some have 2 or 3.

A proposal could visit a Q more than once in it's lifetime, and I want to show the total time spent in the queue calculated across all visits.

I can basically get what I want by using a pivot table with Values = Days, Columns = Q Name, Rows = Proposal ID.

My problem right now is that if there is more than 1 school, the # of days for each Q is multiplied by the # of schools.

I would like to set a calculated field to IIF([# Schools] > 1, [Days] / [# Schools], [Days]), but this can't be saved as an expression. I think it's the division that's failing. Is there a way to do this that will calculate?

I'm also open to a better SQL solution in my data provider, as well, if anyone is willing to look...

3 REPLIES 3

Alex_Gullion
Confirmed Champ
Confirmed Champ

There a two potential issues here. The first is the naming convention of the calculate fields: '# Schools' should contain no special characters. Instead try 'NumberSchools' or just 'Schools' or really anything without special characters. The second issue that could stop this from saving is the field types on your fields. '# Schools' and 'Days' need to be integers or decimals.


Once these issues are cleared up the above IIF([Schools] > 1, [Days] / [Schools], [Days]) should function as desired.

I've set [Num Schools] (renamed) and [Days] as Ints, and it's still not working. [Num Schools] is determined by CountDistinct([School]). Could this be what is breaking the division?

Sorry it has been so long since I replied. Is it still not saving or is it just giving you a seemingly bogus number  now? I recreated using the Count Distinct() but did not run into any issues with the division. I have been testing on OnBase 17.0.1.92 build 

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.