{"id":2390,"date":"2021-12-17T11:36:25","date_gmt":"2021-12-17T02:36:25","guid":{"rendered":"https:\/\/kintools.com\/?post_type=docs&#038;p=2390"},"modified":"2021-12-17T11:36:25","modified_gmt":"2021-12-17T02:36:25","password":"","slug":"totals-not-related-to-bands","status":"publish","type":"docs","link":"https:\/\/kintools.com\/en\/docs\/totals-not-related-to-bands\/","title":{"rendered":"Total unrelated to the band"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Calculating the sum of the report can be done by specifying an expression such as {Sum(DataBand1)}. At the same time, the totals are calculated when the report is rendered. A single value is calculated each time an operation with DataBand is performed. Then all calculated values \u200b\u200bare summed and the total value is displayed. In this case the sum is associated with the band. Calculating totals for Stimulsoft reports can be done in a different way, i.e. instantly. In other words, it computes totals that are not associated with bands. To do this, use a special prefix Totals with a delimiter &#039;.&#039; in front of the function, e.g. {Totals.Sum(DataBand1)}. Functions prefixed with Totals are calculated where the function is called, not the total associated with the band.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Sum function:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>function<\/strong><\/td><td><strong>explanation<\/strong><\/td><td><strong>sample<\/strong><\/td><\/tr><tr><td>{Avg()}when<\/td><td>Calculate the arithmetic mean.<img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Arguments specify one or two objects<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Returns values of different types (double, decimal, long, DateTime, TimeSpan) depending on the selected function.<\/td><td>{Avg(DataSource.Column1)} - Calculates the arithmetic mean of Column1 column.<br>{AvgDate(DataSource.ColumnDate)} - Calculates the average of the dates in the ColumnDate column.<br>{AvgTime(DataSource.ColumnTime)} - Average time by ColumnTime column is calculated. All functions can have two arguments. For example, a report uses several data bands. I need to calculate the arithmetic mean of the first data band. In this case the first argument is the band and the second argument is the object of the calculation - {Avg(DataBand1, DataSource.Column2)}. As a result, it calculates the arithmetic mean of Column2, but only the DataBand1 value.<\/td><\/tr><tr><td>{Count()}<\/td><td>Calculate the number of values or the number of unique values.<br><img decoding=\"async\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" width=\"11\" height=\"11\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Arguments specify a value, an object, or two objects.<br><img decoding=\"async\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" width=\"11\" height=\"11\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Returns various long values.<\/td><td>{Count()} - the result is the number of entries in the data source.&nbsp;<br>{Count(DataBand1, DataSource.Column1)} - The result is the number of entries in Column1 column of DataBand1.&nbsp;<br>{CountDistinct(DataSource.Column1)} - The result is the number of unique entries in DataSource.Column1.&nbsp;<br>{CountDistinct(DataBand2, DataSource.Column2)} - The result is the number of unique entries in Column2 column of DataBand2.<\/td><\/tr><tr><td>{First()}<\/td><td>Display the first value of the specified object.<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Arguments specify one or two objects.<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Returns values for various object types.<\/td><td>{First(DataSource1.Column1)} - The result is the first value of Column1 from DataSource1. {First(DataBand2, DataSource.Column2)} - The result is the first value of Column2 in the DataBand2 band.<br>&nbsp;<\/td><\/tr><tr><td>{Last()}<\/td><td>Display the last value of the specified object.<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Arguments specify one or two objects.<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Returns values for various object types.<\/td><td>{Last(DataSource1.Column1)} - The result is the last value of Column1 from DataSource1. {Last(DataBand2, DataSource.Column2)} - The result is the last value of Column2 in DataBand2.<br>&nbsp;<\/td><\/tr><tr><td>{Max()}<\/td><td>Shows the maximum value of the specified object.<img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Arguments specify one or two objects<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Returns a value of various types double, decimal, long, DateTime, TimeSpan, string depending on the selected function.<\/td><td>{Max(DataSource1.Column1)} - The result is the maximum value from Column1 of DataSource1. {MaxDate(DataSource1.ColumnDate)} - The result is the maximum date from ColumnDate of DataSource1. {MaxTime(DataSource1.ColumnTime)} - The result is the maximum time from ColumnTime of DataSource1.<br>&nbsp;<br><br>&nbsp;<br>&nbsp;{MaxStr(DataSource1.Column1)} - All values are sorted alphabetically. The result is the final value. {Max(DataBand2, DataSource.Column2)} - The result will be the maximum value of Column2 in the DataBand2 band.<\/td><\/tr><tr><td>{Median()}<\/td><td>Displays the average (non-arithmetic) value from the list.<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Arguments specify one or two objects<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Returns various double, decimal, and long values depending on the function selected.<\/td><td>Suppose Column1 contains 5 values: 2, 5, 6, 1, 7. The {Median(DataSource1.Column1)} function displays the average value of this list. So the result is 6. {Median(DataBand2, DataSource.Column2)} - The result is the mean value of Column2 in DataBand2.<\/td><\/tr><tr><td>{Min()}<\/td><td>Shows the maximum value of the specified object.<img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Arguments specify one or two objects<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Returns a value of various types double, decimal, long, DateTime, TimeSpan, string depending on the selected function.<\/td><td>{Min(DataSource1.Column1)} - The result is the minimum value from Column1 of DataSource1. {MinDate(DataSource1.ColumnDate)} - The result is the minimum date from DataSource1&#039;s ColumnDate. {MinTime(DataSource1.ColumnTime)} - The result is the minimum time from ColumnTime of DataSource1.<br>&nbsp;<br><br>&nbsp;<br>&nbsp;{MinStr(DataSource1.Column1)} - All values are sorted alphabetically. The result is the first value. {Min(DataBand2, DataSource.Column2)} - The result is the minimum value of Column2 in the DataBand2 band.<\/td><\/tr><tr><td>{Mode()}<\/td><td>Display the most common values in a list of values.<img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Arguments specify one or two objects<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Returns various double, decimal, and long values depending on the function selected.<\/td><td>{Mode(DataSource1.Column1)}. Suppose Column1 contains a list of values: 2, 2, 6, 7, 7, 8, 7, 6, 5, 9, 4. In this case the result is 7. This is because it will be repeated most frequently in the following list. value.&nbsp;<br>{Mode(DataBand2, DataSource.Column2)} - The result will be the value from Column2 of DataBand2 which is most common.<\/td><\/tr><tr><td>{Rank(,)}<\/td><td>Display the rank of the value. The prefix Totals is required:<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Please specify with arguments:<br><img decoding=\"async\" width=\"13\" height=\"13\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/img_1.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 13px; --smush-placeholder-aspect-ratio: 13\/13;\">\u00a0Objects (object types) for handling and assigning ranks<br><img decoding=\"async\" width=\"13\" height=\"13\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/img_2.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 13px; --smush-placeholder-aspect-ratio: 13\/13;\">\u00a0Value (true or false) to assign tight or non-tight rank<br><img decoding=\"async\" width=\"13\" height=\"13\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/img_3.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 13px; --smush-placeholder-aspect-ratio: 13\/13;\">Sort direction for the values.<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">returns various long values<\/td><td>{Totals.Rank(DataBand1, DataSource.Column1)}. Suppose Column1 contains a list of values: 44, 9, 36, 55, 71. In this case, the values are sorted in ascending order, i.e. 9, 36, 44, 55, 71, and each is given a rank. assigned. Number 9 receives rank 1. 36 - rank 2; 44 - rank 3; 55 - rank 4; 71 - rank 5. By default, it calculates tight ranks and sorts the values for assigning ranks in ascending order.<br>&nbsp;{Totals.Rank(DataBand1, DataSource.Column1, true, StiRankOrder.Dess)} - in this case, it is set to true, hence the lower rank. When ranks are assigned, the values are sorted in descending order because StiRankOrder is set to Desc. To sort in ascending order (used by default), it should be set to Asc (StiRankOrder.Asc). An example of loose rank is {Totals.Rank(DataBand1, DataSource.Column1, false, StiRankOrder.Asc)}. Assume Column1 contains a list of values: 44, 9, 44, 9, 31, 64, 68, 71. Values are assigned in ascending order. That is, 9, 9, 31, 44, 44, 44, 68, 71. In this case the rank would be: 9 - rank 1, 9 - rank 1, 31 - rank 3, 44 - rank 4, 44 - rank 4, 44 - rank 4, 68 - rank 7, 71 - rank 8. That is, when assigning a rank to a number, the rank of the previous value and the number of values with this rank are taken into account.<\/td><\/tr><tr><td>{Sum()}<\/td><td>Display the result of the sum of the values.<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">\u00a0Specified as an argument.<br><img decoding=\"async\" width=\"13\" height=\"13\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/img_1.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 13px; --smush-placeholder-aspect-ratio: 13\/13;\">\u00a0An object (type object) for handling and assigning ranks<br><img decoding=\"async\" width=\"13\" height=\"13\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/img_2.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 13px; --smush-placeholder-aspect-ratio: 13\/13;\">\u00a0condition<br><img decoding=\"async\" width=\"13\" height=\"13\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/img_3.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 13px; --smush-placeholder-aspect-ratio: 13\/13;\">sum formula<br><img decoding=\"async\" width=\"11\" height=\"11\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/strel11.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 11px; --smush-placeholder-aspect-ratio: 11\/11;\">Returns values of various long, decimal, double and TimeSpan types<\/td><td>{Sum(DataSource1.Column1)} - The result is the sum of all Column1 values \u200b\u200bin DataSource1. {SumDistinct(DataSource1.Column1)} - The result is the sum of all unique Column1 values \u200b\u200bin DataSource1. SumTime(DataSource1.Column1) - The result is the sum of times from Column1 of DataSource1. {Sum(DataBand2, DataSource2.Column2)} - The result is the sum of the values \u200b\u200bin Column2 of DataBand2. {SumDistinct(DataBand1, DataSource.Column1, DataSource.Column2)} - The result is the sum of Column2 values \u200b\u200bcorresponding to the unique values \u200b\u200bfrom Column1 in DataBand2.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>A sample for calculating sums not associated with bands.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u00a0For example, I have a master detail report that is a list of products by category.\u00a0<img decoding=\"async\" width=\"604\" height=\"427\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/embim1366.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 604px; --smush-placeholder-aspect-ratio: 604\/427;\">\u00a0<br>This report can calculate results for each category across the report. It is also possible to calculate the percentage of each category in the total. First, let&#039;s calculate the amount of products in the category. To do this, add a footer band to your report template and put a text component with a formula to calculate the sum {Sum(DataBand2, Products.UnitPrice)}. Sum of values \u200b\u200buses the Sum function, whose argument specifies the object for which the sum and data columns are calculated, whose values \u200b\u200bare summarized. Since we need to calculate the quantity of products for each category, we want to calculate the sum over the detailed data band, namely DataBand2. The values \u200b\u200bin the UnitPrice column indicate the price of each product. therefore,<br>\u00a0<img decoding=\"async\" width=\"604\" height=\"437\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/embim1367.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 604px; --smush-placeholder-aspect-ratio: 604\/437;\">\u00a0<br>In this case the result is associated with the data band. Use functions not associated with bands to calculate totals in reports. For this we add the prefix Totals to the function with a &#039;.&#039; separator. As an object, you must specify the data source. The formula to calculate the total for the report would be {Totals.Sum(Products, Products.UnitPrice)}. The result will be displayed on the master band.<br>\u00a0<img decoding=\"async\" width=\"604\" height=\"434\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/embim1368.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 604px; --smush-placeholder-aspect-ratio: 604\/434;\">\u00a0<br>Each time you print a masterband on a report, you will see totals for each report. You can use the results of the calculation to calculate the share of each category in the grand total. Results are displayed as percentages. To calculate the ratio, you have to divide the total by the category and divide the total by the report - {(Sum(DataBand2, Products.UnitsInStock)\/Totals.Sum(Products, Products.UnitsInStock))}. Set the percentage format for the text component where the share is displayed. The result will be displayed on the master band.<br>\u00a0<img decoding=\"async\" width=\"606\" height=\"436\" data-src=\"https:\/\/www.stimulsoft.com\/en\/documentation\/online\/user-manual\/embim1369.png\" alt=\"\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 606px; --smush-placeholder-aspect-ratio: 606\/436;\">\u00a0<br>Therefore, you can calculate any total in your report. To calculate totals that are not related to bands, prefix the function name with Totals and use \u201c.\u201d as the separator.<\/td><\/tr><\/tbody><\/table><\/figure>","protected":false},"excerpt":{"rendered":"<p>\u30ec\u30dd\u30fc\u30c8\u306e\u5408\u8a08\u306e\u8a08\u7b97\u306f\u3001{Sum\uff08Da\u200b\u200btaBand1\uff09}\u306a\u3069\u306e\u5f0f\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002\u540c\u6642\u306b\u3001\u30ec\u30dd [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","footnotes":""},"doc_category":[134],"doc_tag":[],"class_list":["post-2390","docs","type-docs","status-publish","hentry","doc_category-totals","entry"],"year_month":"2026-05","word_count":331,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"yuko.imai","author_nicename":"yuko-imai","author_url":"https:\/\/kintools.com\/en\/author\/yuko-imai\/"},"doc_category_info":[{"term_name":"\u5408\u8a08","term_url":"https:\/\/kintools.com\/en\/docs-category\/totals\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/docs\/2390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/comments?post=2390"}],"version-history":[{"count":1,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/docs\/2390\/revisions"}],"predecessor-version":[{"id":2391,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/docs\/2390\/revisions\/2391"}],"wp:attachment":[{"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/media?parent=2390"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/doc_category?post=2390"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kintools.com\/en\/wp-json\/wp\/v2\/doc_tag?post=2390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}