Model Lookup Function and Aggregate Models

I have two models based on a customer billing object.  They are both aggregate models.  The first is designed to aggregate all open billings for each customer.  The second is designed to aggregate all open billings so that we can view total open billings for our company.  I would like to model lookup the value displayed in the second object into each line of the first aggregate model, but am having trouble doing so. Example:

Aggregate 1:
                     Open Billings (each line will possible contain multiple billing)
Customer 1 - $30
Customer 2 - $60
Customer 3 - $40

Aggregate 2 - 

Total Open Billings: $130

I would like to get the $130 value place on each line of aggregate 1.  Thanks for the help.

Danny -
Thanks for your question.  I assume your second aggregate model only has one row?  In that case, you should be able to do a model lookup like this on Aggregate Model 1:

MODEL_LOOKUP("AggregateModel2Name","totalOpenBilling","Id","1")

Skuid automatically adds Id’s for reference to the aggregate model rows, so to ensure that the Id of the one row in Aggregate Model 2 is equal to “1”, move that model to the top in your composer so it loads first.

In addition, remember to replace the totalOpenBilling with the actual alias name generated on Aggregate Model 2 for the total amount.

Hope this helps!
Christine

Thanks, Christine.  
Yes, the second aggregate model only has 1 row.
With your solution I am now pulling a number, but it is the incorrect number.  The number is larger than the number shown on Aggregate 2.  Any ideas? I checked the condition on both models to ensure they were the same, and they both feed from the same object.

Can you post an image of your model lookup function and your aggregate model setup?

Aggregate 1:
!(https://us.v-cdn.net/6032350/uploads/attachments/RackMultipart20161228-36594-sawu65-Screen_Shot_2016-12-28_at_3.09.39_PM 2 inline.png “Image: https://d2r1vs3d9006ap.cloudfront.net/s3\_images/1529471/RackMultipart20161228-36594-sawu65-Screen\_Shot\_2016-12-28\_at\_3.09.39\_PM\_\_2\_\_inline.png?1482960157”)
Aggregate 1 UI field: !(https://us.v-cdn.net/6032350/uploads/attachments/RackMultipart20161228-72316-btlw74-Screen_Shot_2016-12-28_at_3.21.22_PM 2 inline.png “Image: https://d2r1vs3d9006ap.cloudfront.net/s3\_images/1529472/RackMultipart20161228-72316-btlw74-Screen\_Shot\_2016-12-28\_at\_3.21.22\_PM\_\_2\_\_inline.png?1482960298”)
Model Lookup in Aggregate 1 UI field formula:
!(https://us.v-cdn.net/6032350/uploads/attachments/RackMultipart20161228-39069-2ctje6-Screen_Shot_2016-12-28_at_3.08.46_PM 2 inline.png “Image: https://d2r1vs3d9006ap.cloudfront.net/s3\_images/1529473/RackMultipart20161228-39069-2ctje6-Screen\_Shot\_2016-12-28\_at\_3.08.46\_PM\_\_2\_\_inline.png?1482960335”)
Aggregate 2:
!(https://us.v-cdn.net/6032350/uploads/attachments/RackMultipart20161228-90180-8ntrt4-Screen_Shot_2016-12-28_at_3.09.39_PM 2 inline.png)
Aggregate 2 Aggregation:
!(https://us.v-cdn.net/6032350/uploads/attachments/RackMultipart20161228-99816-12qm5mh-Screen_Shot_2016-12-28_at_3.20.34_PM 2 inline.png)

Your setup looks good to me, do you have multi-currency enabled in your org? I know that when you aggregate a currency field, the result is in the default orgs currency. If this isn’t the issue, can you grant Skuid login access so we can take a look at the page?