<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" >

<channel><title><![CDATA[Banyan - Blog]]></title><link><![CDATA[https://www.banyan.io/blog]]></link><description><![CDATA[Blog]]></description><pubDate>Fri, 30 May 2025 23:56:47 -0500</pubDate><generator>Weebly</generator><item><title><![CDATA[Roll to 1 - Being smart about Roll up Summary fields]]></title><link><![CDATA[https://www.banyan.io/blog/roll-to-1-being-smart-about-roll-up-summary-fields]]></link><comments><![CDATA[https://www.banyan.io/blog/roll-to-1-being-smart-about-roll-up-summary-fields#comments]]></comments><pubDate>Tue, 24 Oct 2017 05:00:29 GMT</pubDate><category><![CDATA[Admins]]></category><category><![CDATA[Developers]]></category><guid isPermaLink="false">https://www.banyan.io/blog/roll-to-1-being-smart-about-roll-up-summary-fields</guid><description><![CDATA[Do you have a lot of fields that needs to roll up to the parent object? Running out of roll up summary fields? Here's a simple trick you can use to minimize your consumption of roll up summary fields.&nbsp;In this example, I have Quotes and Quote Line Items. I have couple of fields at the Quote Line Item level that I want to roll up to the Quote level.1. Total Price (which is the list price x quantity with discounts applied) of all line items2. # of Line items where Type = One Time3. # of Line i [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">Do you have a lot of fields that needs to roll up to the parent object? Running out of roll up summary fields? Here's a simple trick you can use to minimize your consumption of roll up summary fields.&nbsp;<br /><br />In this example, I have Quotes and Quote Line Items. I have couple of fields at the Quote Line Item level that I want to roll up to the Quote level.<br /><br />1. Total Price (which is the list price x quantity with discounts applied) of all line items<br />2. # of Line items where Type = One Time<br />3. # of Line items where Type = Recurring<br />4. Total # of Line items<br /><br />Typically these are 4 roll up summary fields at the quote level.<br /><br />In this solution you can see how you can get the same roll up information by using only 1 roll up summary field at the quote level and formula fields.<br /><br /><strong>Step 1: Create a formula field on the Quote line item (Child object)</strong><br /><br />I'm using a formula number field with 2 decimal places. In that formula I'm constructing a 11 digit figure.&nbsp;<br /><br />1. The 1st digit is for count. So whatever the result of the formula is, the first digit should always be 1.<br />2. If the Type = One Time, the 3rd digit should be 1.<br />3. If the Type = Recurring, the 5th digit should be 1.<br />4. Last 6 digits is reserved for the Total price of the line item, that'll be added to this value.<br /><br />So, if it's a One Time line item with a Total price of 40K, the formula value would be<br /><strong><font color="#da4444">1</font></strong><u>0<strong><font color="#da4444">1</font></strong></u>000<strong><font color="#da4444">40000</font></strong>.00<br /><br />If there's a second line items which is of the type Recurring with a Total price of 20K, the formula value would be <strong><font color="#da4444">1</font></strong>00<u>0<strong><font color="#da4444">1</font></strong></u>0<strong><font color="#da4444">20000</font></strong>.00</div>  <div><div class="wsite-image wsite-image-border-none " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center"> <a> <img src="https://www.banyan.io/uploads/6/2/3/5/62354877/published/screen-shot-2017-10-23-at-11-35-12-pm.png?1508822339" alt="Picture" style="width:auto;max-width:100%" /> </a> <div style="display:block;font-size:90%"></div> </div></div>  <div class="paragraph"><br />&#8203;<strong>Step 2: Create a Roll up summary field at the Quote (Parent)</strong><br /><br />Roll up (Sum) the formula field created in Step 1 to the parent level. If you roll up the values from the above example, you'll get <strong><font color="#da4444">2</font></strong>0<strong><font color="#da4444">1</font></strong>0<strong><font color="#da4444">1</font></strong>0<strong><font color="#da4444">60000</font></strong>.00 where the,<br /><br />1st digit = Count of Line Items (<strong>2</strong>)<br />2nd &amp; 3rd digits = Count of Line items where Type is One Time (<strong>01</strong>)<br /><span>4th &amp; 5th digits = Count of Line items where Type is Recurring (<strong>01</strong>)<br />6th digit to end, including decimal places = Sum of Total price of all Line items (<strong>60,000</strong>)<br /><br /><strong>Step 3: Create formula fields to reflect all the information</strong><br /><br />Create 4 formula fields, each looking at the value from Step 2 and just taking the information that's required. For the Total Price of all line items, create a formula to just get the last 6 digits from the roll up value.</span></div>  <div><div class="wsite-image wsite-image-border-none " style="padding-top:10px;padding-bottom:10px;margin-left:0;margin-right:0;text-align:center"> <a> <img src="https://www.banyan.io/uploads/6/2/3/5/62354877/screen-shot-2017-10-24-at-12-49-57-am_orig.png" alt="Picture" style="width:auto;max-width:100%" /> </a> <div style="display:block;font-size:90%"></div> </div></div>  <div class="paragraph">You can create that as a currency formula field and use the above formula.</div>  <span class='imgPusher' style='float:left;height:0px'></span><span style='display: table;width:auto;position:relative;float:left;max-width:100%;;clear:left;margin-top:0px;*margin-top:0px'><a><img src="https://www.banyan.io/uploads/6/2/3/5/62354877/screen-shot-2017-10-24-at-12-50-11-am.png?250" style="margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 10px; border-width:0; max-width:100%" alt="Picture" class="galleryImageBorder wsite-image" /></a><span style="display: table-caption; caption-side: bottom; font-size: 90%; margin-top: -10px; margin-bottom: 10px; text-align: center;" class="wsite-caption"></span></span> <div class="paragraph" style="display:block;">In this example, the Roll up of Quote line items field in the Roll up summary field from Step 2.&nbsp;<br /><br />The Total Price of all line items field is the formula field from Step 3.<br /></div> <hr style="width:100%;clear:both;visibility:hidden;"></hr>  <div class="paragraph">Similarly, you can create formula fields for the remaining 3 fields.<br /><br />Using this approach you can come up with a lot of permutations and combinations for your use cases.</div>]]></content:encoded></item></channel></rss>