We're currently using a bunch of javascript to make percentage calculations on an aggregate model.

I'd love to replace that with a ui-only formula field.

Here's my attempt at a formula:

{{TotalRecords}} / MODEL_LOOKUP('numberOfSchedulingLeads', 'TotalRecords', 'Id', '4')

The formula isn't returning anything. Is my syntax ok?

The fourth row of my model (Id=4) is the roll-up summary row. TotalRecords and Percentage are both COUNT(Id), and we're using javascript to change the values of Percentage to a percent of the column sum.

The ui-only field is called PercentUI, but isn't showing up in the model at all.

I'd love to replace that with a ui-only formula field.

Here's my attempt at a formula:

{{TotalRecords}} / MODEL_LOOKUP('numberOfSchedulingLeads', 'TotalRecords', 'Id', '4')

The formula isn't returning anything. Is my syntax ok?

The fourth row of my model (Id=4) is the roll-up summary row. TotalRecords and Percentage are both COUNT(Id), and we're using javascript to change the values of Percentage to a percent of the column sum.

The ui-only field is called PercentUI, but isn't showing up in the model at all.

Matt Sones, Champion

- 31,904 Points

Posted 4 years ago

Rob Hatch, Official Rep

- 44,308 Points

This is a place where our documentation needs to be improved. ( I don't think we have a tutorial on UI Only fields published yet...)

The syntax for lookup fields is as follows:

MODEL_LOOKUP("ModelName","FieldNametoBeReturned","FieldNameToMATCHinCurrentModel",{{MatchingValueFromCurrentModel}})

The first three properties need to be in quotes.

The last property is a data merge, so it needs to be in Braces.

Hopefully this helps.

The syntax for lookup fields is as follows:

MODEL_LOOKUP("ModelName","FieldNametoBeReturned","FieldNameToMATCHinCurrentModel",{{MatchingValueFromCurrentModel}})

The first three properties need to be in quotes.

The last property is a data merge, so it needs to be in Braces.

Hopefully this helps.

Matt Sones, Champion

- 31,904 Points

So, if I want to return the value of the TotalRecords field from the numberOfSchedulingLeads model where Id = 4 (or actually, just get the value of {{TotalRecords}} from the last row of the model... how would I do that? can I do that with a model lookup function? Seems like I actually need a query of some kind?

The current model is the numberOfSchedulingLeads model... not sure if that makes a difference.

The current model is the numberOfSchedulingLeads model... not sure if that makes a difference.

- 10,910 Points

Hey Ryan, this should be doable in Skuid. You create the formula field in the "aggregations" section of your aggregate model, and then just drag it in to your table.

What version of Skuid are you running? in some of the earlier Banzai versions you could only add aggregate model fields from the Add > Model Field(s) button on your table.

Also, make sure your table is set to the right model. Do either of these fixes work for you?

What version of Skuid are you running? in some of the earlier Banzai versions you could only add aggregate model fields from the Add > Model Field(s) button on your table.

Also, make sure your table is set to the right model. Do either of these fixes work for you?

- 478 Points

Thanks Anna. Dragging and dropping did get the formula on to the table. I wasn't able to add it using the add model fields button. However my formula isn't working. It's showing up as 0.00 so I guess my formula is wrong. How do I reference the other aggregations in the formula?

Matt Sones, Champion

- 31,904 Points

Ryan, you can use merge syntax with the unique id that you give the other fields, i.e. {{sumMyOtherAggFieldc}}

- 478 Points

Yea that was it. Dumb mistake. But this is huge so thanks for the help guys,.

- 10,910 Points

Not dumb! Aggregate model field aliases can be tricky. Happy Skuidifying!

- 10,910 Points

Guys! I just (finally) published the ui-only fields tutorial. Pretty basic, but at least there's something! http://help.skuidify.com/m/models-conditions-filters/l/378313-ui-only-fields

Matt Sones, Champion

- 31,904 Points

The Staff of Gandalf for only $2,500! What a steal!!

- 10,910 Points

You'd be surprised what you can find on the internet ;)