You are reading the article How To Calculate Total Assets? With Examples updated in November 2023 on the website Tai-facebook.edu.vn. We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested December 2023 How To Calculate Total Assets? With Examples
Definition of Total AssetsTotal assets (T.A) can be defined as sum total of the money value of all monetary and non-monetary economic resources owned, managed, and controlled by an organization which is either having current economic value or is capable of generating future economic benefits for the organization either within a short period of time or in the long run.
Start Your Free Investment Banking Course
Download Corporate Valuation, Investment Banking, Accounting, CFA Calculator & others
ExplanationAssets, in simple terms, are defined as anything and everything a business owns that have value, can be converted to cash, and is categorized as current or non-current assets. Total asset is the sum of all current and non-current assets equal to the sum of total liabilities and stockholder’s equity on the other side of the balance sheet. T.A. disclose in the balance sheet as per the applicable GAAP laws of the land. For example, these may be listed on a balance sheet in the order of their liquidity. The valuation of each asset is recorded as the asset’s purchase value. When all the assets are classified and listed in the appropriate order on the balance sheet, the sum of their valuation is combined to derive the T.A. value.
The formula of Total AssetTotal Assets = Liability + Owners Equity
Or
Total Assets = Liabilities + Owners Equity + Net Profit – Drawings
or
Total Assets = Non-Current Assets + CURRENT ASSETS
Where
Current Assets: Current assets are Those assets that can be converted into cash or cash and cash equivalents within one year of acquisition. Examples: cash, cash, cash equivalent, accounts receivable, marketable securities, inventories, and prepaid expenses.
Non-Current Assets: Non-current assets generate economic benefits from a period greater than one year from the acquisition or the balance sheet date. Examples: fixed assets, plant, and machinery, furniture, land and building, intangible assets, goodwill, etc.
How to Calculate Total Assets?To calculate T.A following steps must be followed –
Identify Your Assets: The first step to calculating T.A. is the identification of all assets. One must know whether the item will generate any economic benefits to the organization; if yes, then list such items. Identification and valuation of intangible assets may be a problem. Intangible assets will also form part of T.A.
List Your Asset: The foremost step to be taken is to list the values of any current asset like cash, inventory, money owed to you, and fixed assets like buildings and machines. Also, the value of long term investments such as stocks and bonds should be considered.
Valuation: Next step is to identify the value of the asset. This may be either the asset’s cost or the present value of sum total of future economic benefits that any asset will generate. Depending upon the use, certain other valuations like net realizable value, historical cost, net replacement value, or future economic value may be applied for valuation.
Add up Your Assets: Add all the assets to find the final amount.
Check the Basic Accounting Formula: One can cross verify the sum total of assets with the help of the accounting equation, which says T.A. will always be equal to sum total of total liabilities + owner’s equity. Where equity is the owner’s fund of a company, such as capital or shareholders fund, and liability is the company’s debts that need to be paid off, such as loans, operation expenses, salaries, etc.
Examples of Total AssetsFollowing are the examples given below:
Example #1From the following details, ascertain the T.A value: –
Particulars
Amount($)
Land 50,00,000
Machinery 80,00,000
Accumulated Depreciation on Machine 30,00,000
Inventory 60,00,000
Furniture 40,00,000
Accumulated Depreciation on Furniture 10,00,000
Cash 10,00,000
Bank 40,00,000
Solution:
Total Assets = Land + (Machinery – Accumulate Depreciation on Machinery) +inventory + (furniture – Accumulated Depreciation on Furniture) + Cash +bank
Total Assets = 50,00,000 + (80,00,000 – 30,00,000) + 60,00,000 + (40,00,000 – 10,00,000) + 10,00,000 + 40,00,000
Total Assets = 50,00,000 + 50,00,000 + 60,00,000 + 30,00,000 + 10,00,000 + 40,00,000
Total Assets =$2,40,00,000
Hence Total Assets of Amazon Inc. are $2,40,00,000.
Example #2Identify and determine the T.A value from the following items
Particulars Amount ($)
Land 1,00,000
Machinery 2,00,000
Cash 50,000
Warranty claim provision 20,000
Debentures issued 20,000
Solution:
Identification
Particulars
Asset -Yes/No
Remarks
Land Yes –
Machinery Yes –
Cash Yes –
Warranty claim provision No It’s a contingent liability that may be paid in future
Debentures issued No It’s a long-term liability disclosed on the liability side
Total Assets is calculated as
Therefore, Total Assets = Land + Machinery + Cash
Total Assets = 2,00,000+1,00,000+50,000
Total Assets = 3,50,000
Balance SheetSample Balance Sheet (Asset side)
Particulars
Current FY Fig($)
Previous FY Fig($)
Non-Current Assets-
Fixed Assets-
Land, Buildings, furniture, etc.
Non-Current Investments
Deferred Tax Assets
Long-Term Loans & Advances
Current Assets
Inventories, Accounts Receivable, etc
(Note: -Above B/s does not contain all items that must be disclosed. It’s just a sample for understanding)
Total Assets vs Current AssetsT.A. is the sum total of all the current and non-current assets and forms the asset side of the balance sheet. In contrast, current assets are the assets that are part of total assets and capable of converting, utilizing, and realizing into cash or cash equivalent within one year of acquisition or balance sheet date. Current assets are the most liquid assets and are easily realizable at any point in time and include cash and cash equivalent, inventory, accounts receivable, etc. At the same time, T.A. includes all current and other non-current assets like land and building, plant and machinery, equipment, vehicles, goodwill, etc.
Advantages
Total assets produce positive economic value for a financial entity, whether tangible or intangible.
Total assets represent the company’s own value and can be converted into cash whenever required.
It shows the capacity of a profit-oriented enterprise that helps contribute directly or indirectly to future net cash flows and in providing services.
One can measure profit generation performance by comparing it with benchmark accounting ratios like total asset margin ratio, net profit to T.A. ratio, Total assets turnover ratio, etc.
LimitationsSome of the limitations are given below:
Identification and valuation of intangible assets is a challenge and might affect T. A valuation if these are not evaluated properly.
The balance sheet discloses assets at a historical cost which does not reveal the actual realizable value in certain cases.
Assets like employees who do not possess monetary value cannot form part of the total asset but play a great role in running a business.
ConclusionAsset plays a crucial role in studying the financial world. An entity should try to utilize its assets in the best possible manner. A firm’s health is decided based on various parameters in which T.A. play a crucial part. It helps predict the profit a firm generates, determine its efficiency level, and make action plans accordingly for meeting our targets.
Recommended ArticlesYou're reading How To Calculate Total Assets? With Examples
How To Calculate Mean (Examples, Calculator)
Mean Formula (Table of Contents)
Start Your Free Investment Banking Course
Download Corporate Valuation, Investment Banking, Accounting, CFA Calculator & others
Mean FormulaThe mean, also known as the arithmetic average, is a statistical measure used to determine the center of a dataset. It is calculated by summing all the data points and dividing the sum by the number of data points in the set. The mean plays a fundamental role in data analysis and is a common method for measuring central tendency.
A formula for Mean is as below:
Mean = Sum of All Data Points / Number of Data Points.
In the Assumed Mean method, which is not commonly used, one selects a random value from the dataset and assumes it to be mean. Then, one calculates the deviation of the data points from this value to determine the mean.
Mean = Assumed Mean + (Sum of All Deviations / Number of Data Points)
Examples of Mean Formula (With Excel Template)Let’s take an example to understand the calculation of the Mean formula in a better manner.
You can download this Mean Template here – Mean Template
Example #1Let’s say you have a data set with 10 data points, and we want to calculate the mean for that.
Data set: {4,6,8,9,22,83,98,45,87,10}
Solution:
Mean = Sum of All Data Points / Number of Data Points
Mean = (4+6+8+9+22+83+98+45+87+10) / 10
Mean = 372 / 10
Mean = 37.2
Let’s use the Assumed Mean method to find the mean in the same example.
Let’s assume that the mean for the given data set is 40. So Deviations will be calculated as:
For 1st data point, 4 – 40 = -36
Similarly, We have to calculate the deviation for all the data points.
Mean = Assumed Mean + (Sum of All Deviations / Number of Data Points)
Mean = 40 + (-36 -34-32-31-18+43+58+5+47-30) / 10
Mean = 40 + (-28) / 10
Mean = 40 + (-2.8)
Mean = 37.2
Example #2Let us take IBM stock and we will take its historical prices from the last 10 months and will calculate the annual return for 10 months.
Solution:
Mean = (3.74% + 1.07% +4.34% + (-23.66)% + 7.66% + (-7.36)% + 18.25% + 2.76% + 1.48% + 0.00%) / 10
Mean = 8.28% / 10
Mean = 0.83%
So if you see here, in the last 10 months, IBM’s return has fluctuated very much.
Overall, the average return in the last 10 months is only 0.83%.
ExplanationMean is a simple average of the data points in a data set and helps us understand the average point. But there are certain limitations to using mean. The mean value is easily distorted by extreme values/outliers. These extreme values can be very small or very large, which can distort the mean. For example: Let’s say we have returns of stock for the last 5 years given by 5%, 2%, 1%, 5%, -30%. Mean for these values is -3.4% ((5+2+1+5-30)/5). So although the stock has provided a positive return for the first 4 years, we have an average negative mean of 3.4%. Similarly, if we have a project for which we analyze the cash flow for the next 5 years. Let’s say the cash flows are: -100, -100, -100, -100, +1000.
The mean is 600 / 5 = 120. Although we have a positive mean, we are only getting money in the last year of the project, and it can happen that if we incorporate the time value of money, this project will not look as lucrative as it is now.
Relevance and Uses of Mean FormulaMean is very simple yet one of the crucial elements of statistics. It is the basic foundation of statistical analysis of data. It is very easy to calculate and easy to understand also. If we have data set with data points scattered everywhere, the mean helps us see that data point’s average. For example: If a stock X has returns from the last 5 years as 20%, -10%, 3%, -7%, 30%. If you see, all the years have different returns. The mean for this is 7.2% ((20-10+3-7+30)/5). So we can now simply say that, on average, the stock has given us a yearly return of 7.2%.
But if we see mean in a silo, it has relatively less significance because of the flaws discussed above and is more of a theoretical number. So we should use the mean value carefully and not analyze the data based only on the mean.
Mean Formula Calculator
You can use the following Mean Calculator
Sum of All Data Points Number of Data Points Mean Formula Mean Formula = Sum of All Data Points = Number of Data Points
0
= 0
0
Recommended Articles
This is a guide to Mean Formula. Here we have discussed how to calculate the Mean, along with practical examples. We also provide a Mean calculator with a downloadable Excel template. You may also look at the following articles to learn more –
How To Create Minitab Boxplot With Examples?
Definition of Minitab boxplot
Start Your Free Data Science Course
Hadoop, Data Science, Statistics & others
What is a boxplot?A boxplot is a graphic that displays a five-number report and helps to show descriptive data. It allows us to investigate the distributional properties of a set of scores and their level. The important focus of the chart (the “box”) depicts the interquartile range, which is the middle section of the data. The first quartile (the 25% mark) and the third quartile are located at the container’s ends (the 75 percent mark). The minimum (the least number in the set) is at the left of the chart, while the max is at the extreme right. Lastly, the mean is represented by a vertical bar in the middle of the box. Any data value below the lower bound is referred to as a lower-side outlier, while any data value over the upper bound is referred to as a higher-side outlier.
How to Create Minitab boxplot?Box plots are often used to display overall response characteristics for a group. They’re an excellent approach to seeing the range and other features of a vast firm’s responses. For data processing, Minitab will be used. On the right side of the vertebral column, numerical data is associated. Minitab will treat figures separated by commas as text rather than numbers. The data for the sample should be chosen at random. For example, random samples are used in statistics to make generalizations or assumptions about a population. The answers may not reflect the population if the data was not obtained randomly.
Steps:
Creating a data set:
The box inside a boxplot moves out from the lower quartile (Q 1) to the top quartile (Q 2). (Q2). The median is represented by the lines inside the box (Q). The lower whisker travels from the bottom quartile (Q1) to the lowest quartile (Q2), which is not an outlier, and the higher whisker travels from the highest quartile (Q2) to the highest quartile (Q3), which is not an outlier. On the boxplot, potential outliers are denoted by a *. Measured variables that are 1.5/QR just below the lower quartile or 1.5/QR above the upper quartile, where IR stands for interquartile range, are considered outliers.
If the data only has one factor, choose Only Yrightarrow (for example, the fruit color in a market).
Rightarrow a large number of Y’s. If there are several parameters, it’s simple (for example, the fruit’s color and size in a market).
If any type variable classifies only a single variable, select Only Y right arrow with Groups (for instance, if a fruit groups colour).
If categorical variables group several variables, use Many Y’s right arrows with Group (for example, the colour of fruit in a market organized by nation and fruits category). Then press the OK button.
Note:
If our data collection contains outliers, the box and whiskers graphic may not reflect the minimum or maximum value. Instead, one and a half times the interquartile range (1.5*IR) is represented at the ends of the whiskers.
Minitab boxplot ExampleDifferent examples are mentioned below:
Example #1Step-1:
Consider the following sample of 15 guys’ ages in centimeters in a class:
50,52,54,56,58,60,62,64,66,68,70,72,74,76,80
In Minitab, enter the following data in the first column:
Step-2:
Step-3:
Step-4:
Step-5:
Since both whiskers are around the same length and the middle line is placed in the center of the box, the age range is nearly symmetrical without any outliers.
Example #2Consider Statistical Data for an example to calculate the values:
Team1 20 30 35 40 45 50
52 54 55 60 62 70
Team2 21 31 34 42 46 56
61 80 82 83 84 85
Step-1:
Pick both C1 and C2 from the left-hand box in the box below “Graph variables:”
Step-3:
Step-4:
Step-5:
The final result is shown here:
ConclusionTherefore we have provided the working of Boxplot in Minitab with different scenarios. The boxplot interpretation is shown in the screenshots.
Recommended ArticleThis is a guide to the Minitab boxplot. Here we discuss the definition, What a boxplot is, How to Create a Minitab boxplot, and examples along with code implementation and output. You may also have a look at the following articles to learn more –
How To Translate Text In Excel With Examples?
Introduction to Excel Translate Function
Excel Translate is a powerful in-built function to convert any word or sentence into several languages. This tool is ideal for professionals working across different native languages.
Moreover, it facilitates effective communication by sharing documents with colleagues and business partners in multiple languages, enhancing readability and preventing confusion.
Where is the Translator in Excel?In Excel, the “Translate” feature is available under the “Language” section of the “REVIEW.”
How to Translate in Excel?Let us learn how to translate words and sentences from one language to another with the help of the following examples.
You can download this Translate Excel Template here – Translate Excel Template
Example #1Step 2: Type the word you want to convert and select the”Fro” and“T” languages from the options. For example, type Today and select English in From and Hindi in the To section. The result will display automatically.
Note: The Swap option of the translator function can be used to interchange the To and From languages.
Note: You also directly select the cell you want to translate. The selected text will display automatically in the upper box. Then you have to choose the target language. Text is immediately translated into the target language, as shown below.
Example #2Suppose you have the below data of some words in English, and you want to translate those words into another language like Chinese and French.
The result will be displayed in the menu as shown below.
Note: Remember that the translated words will only appear on the menu. You have to copy-paste the translated word into their respective cells.
Step 4: Repeat the same procedure for Chinese and French.
All the words are now translated into different languages, as shown above.
Example #3You can also change a long sentence from one language to another. For example, there is a long sentence in English -“Hello, my name is David. I love cooking and listening to music. “You want to translate this sentence into French.
Type the above sentence in the From section and select French in To. The output is shown in the image below.
How to Install Functions Translator Add-InsFollow the below procedure to install the Functions translator in Excel.
The Function Translator is installed successfully. It will appear at the bottom, as shown below.
The function Translator will appear in the Home tab. It will have two options: Reference and Translator.
A language settings dialog will open. This dialog box allows you to select From and To
Step 8: Select From and To languages.
To is the language you know and are familiar with, and From is the language you want to find or translate. Note: You can change the language anytime through the Preferences pane. The swipe button, represented in an up-down arrow, allows you to switch the language easily.
For example, if you know French and want to translate Excel formulas into English. You can select English in the From and French in the To, as shown below.
Step 10: Enter the formula you want to translate.
Things to Remember
The shortcut to open the translate window is Alt + Shift + F7Excel’s’s translator result may be prone to errors and inconsistenciesExcel’s translator is mainly suitable for personal understanding.
The translated text or sentence may not be ideal for professional use.
You should have an internet connection to access the Excel function translator.
You can search for the Excel function under the dictionary of Function Translator.
Recommended ArticlesThis article is a guide to Translate in Excel. Here we learn to translate text to different languages using Translate in Excel and how to add a translate option in Quick Access ToolBar. You can also go through our other suggested articles –
How To Use Excel Vba Instrrev With Examples?
VBA InStrRev Function
Knowing the occurrence of a string in another string can be very handy while working with day to day data. Obviously, we can do it manually by calculating the occurrence of the string in another string but that would the task very hefty. So to make it easier we have a function in VBA which is known as INSTRREV which is used to find the occurrence.
As explained above, INSTRREV in Excel VBA is used to find an occurrence of a string in another string. This function finds the first occurrence of a string in the target string and returns the value. Now we have to remember that as it gives the occurrence of the string so the returned value is numeric. Also as it is a comparison function so like other functions in VBA there are three basic comparisons methods.
Watch our Demo Courses and Videos
Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.
Syntax of InStrRev in Excel VBAThe syntax for VBA InStrRev function in excel is as follows:
Now let us break down the syntax and learn about it, String is the main string from where we want to find the occurrence of a substring, Start is the numeric occurrence we provide to the string. If no start parameter is provided the function starts looking a string from the end of it. And compare is the comparison method we provide to the function. There are three types of comparison for this function:
To use Option Compare which is (-1). It is also known as VbUseCompareOption.
To use Binary Compare which is (0). It is also known as VbBinaryCompare.
To use Text Compare which is (1). It is also known as VbTextCompare.
Again if none of the compare options is provided then the function automatically considers it as a binary compare.
Now let us use this function in a few examples and look at how to use this function.
How to Use Excel VBA InStrRev?Now let us try with some examples on VBA InStrRev in Excel.
You can download this VBA InStrRev Excel Template here – VBA InStrRev Excel Template
Example #1 – VBA InStrRevStep 2: Once we enter the VB editor we can see in the header section, there is an option of insert. Insert a new module from that option as shown below.
Step 3: Now let us start our subprocedure in the module as shown below.
Code:
Sub
Sample()End Sub
Step 4: Now declare a variable as an integer which will hold the output value of the function for us.
Code:
Sub
Sample()Dim
AAs Integer
End Sub
Step 5: Now in the variable use the INSTRREV function to find the occurrence of “ “ in the string “ I am a Good Boy” as follows.
Code:
Sub
Sample()Dim
AAs Integer
A = InStrRev(" I am a Good Boy", " ")End Sub
Step 6: Now display the value stored in variable A using the msgbox function.
Code:
Sub
Sample()Dim
AAs Integer
A = InStrRev(" I am a Good Boy", " ") MsgBox AEnd Sub
Step 7: Let us execute the above code to get the following result.
We get the result as 13 because we did not provide the start position to the function so it automatically calculated the occurrence from the end and so the result. It is found that “ “ is on the 13th position of the string when we search it from the end.
Example #2 – VBA InStrRevIn the above example, we did not provide any start position to the string. Let us provide this time in this example. Let us find out from the second position where does the “ “ occurs in the string.
Step 1: Insert a new module from that option as shown below.
Step 2: Let us again define a subprocedure for our second example.
Sub
Sample1()End Sub
Step 3: Declare another integer variable for the example.
Code:
Sub
Sample1()Dim
AAs Integer
End Sub
Step 4: Now in Variable A let us find the occurrence of the “ “ from the second position using the INSTRREV function as follows.
Code:
Sub
Sample1()Dim
AAs Integer
A = InStrRev(" I am a Good Boy", " ", 2)End Sub
Step 5: Now use msgbox function to display the value stored in A.
Code:
Sub
Sample1()Dim
AAs Integer
A = InStrRev(" I am a Good Boy", " ", 2) MsgBox AEnd Sub
Step 6: Now run the above code to find out the below result as shown below,
We get 1 as a result as we count 2 we get I and after one position we get the occurrence of “ “.
Example #3 – VBA InStrRevIn this example let us use the compare methods. We have a string “ India is the Best” and let us find the string “E” using both text and binary compare methods.
Step 1: In the same module 1, write another subprocedure for example 3.
Code:
Sub
Sample2()End Sub
Code:
Sub
Sample2()Dim
A, BAs Integer
End Sub
Step 3: In variable A let us use the INSTRREV function with the text comparison as follows.
Code:
Sub
Sample2()Dim
A, BAs Integer
A = InStrRev("India is the Best", "E", , vbTextCompare)End Sub
Step 4: Now display the value stored in A using the msgbox function.
Code:
Sub
Sample2()Dim
A, BAs Integer
A = InStrRev("India is the Best", "E", , vbTextCompare) MsgBox AEnd Sub
Step 5: In variable B let’s use the binary comparison for the same string as follows.
Code:
Sub
Sample2()Dim
A, BAs Integer
A = InStrRev("India is the Best", "E", , vbTextCompare) MsgBox A B = InStrRev("India is the Best", "E", , vbBinaryCompare) MsgBox BEnd Sub
Step 6: Execute the above code to find the first result stored in variable A which is as follows.
Step 7: Press OK to see the result stored in variable B.
We get 0 as the result for binary compare because in our string “e” is present not “E”. In binary values both of these are different. So if a value is not found in the string we get a result as 0.
Things to Remember
The value returned by this function is numeric.
If the substring is not found the value returned is 0.
Start position is optional. If it is not provided, by default function search the occurrence from the end of the string.
The comparison methods are also optional.
Recommended ArticlesThis is a guide to VBA InStrRev. Here we discuss how to use Excel VBA InStrRev along with practical examples and downloadable excel template. You can also go through our other suggested articles –
How Distinct Command Works With Examples
Introduction to MongoDB Distinct
MongoDB distinct is used to find distinct values from a single collection and retrieved results of the query in an array, MongoDB distinct is used to retrieve distinct values from the collection. Distinct in MongoDB is very important and useful to retrieve distinct data from a single collection. Distinct is different from MongoDB find the method, distinct will returns the array of all the distinct values from the collection. This will return only distinct data from the collection, if in one collection thousands of documents and we need only those documents which were distinct each other same time we have used distinct in MongoDB.
Start Your Free Data Science Course
Hadoop, Data Science, Statistics & others
SyntaxBelow is the syntax of distinct in MongoDB.
collection_name.distinct (field, query)
collection_name.distinct (field, query, options)
Parameter
Collection name: Collection name is defined as retrieved documents from the collection by using a distinct method. We can retrieve distinct values from the collection by using distinct methods.
Distinct: This will return only distinct data from the collection. This is very important and useful to retrieve distinct data from a single collection. This is used to retrieve distinct values from the collection.
Field: Field has specified that return distinct value from the field we have specified with distinct methods. The field is an essential and useful parameter in a distinct method.
Options: This is an optional parameter in MongoDB distinct command. This is an additional option used in the distinct command. It is available only if the document specifies the options.
Query: Query distinct method defines the document from which we have to retrieve the collection’s distinct value. The query is a handy and important parameter in a distinct method.
How Distinct Command works in MongoDB?Below is the working of distinct command:
The distinct method in MongoDB uses an index on the field while doing a distinct operation on collection.
This will return only distinct data from the collection, if in one collection thousands of documents and we need only those documents which were distinct each other same time we have used distinct in MongoDB.
When we have used or specifies collation in a distinct method, we need to specify a mandatory locale to define the field with collation in a distinct method.
If the field’s values were an array, then distinct methods consider each element of the field as a separate value.
If suppose array contains a value as [1, 2, 1, [1], 2], then distinct methods consider it as [1, 2, [1]] as a result.
Below example states will consider the array field as each element as separate values.
Code #1
use stud_array
Output:
Code #2
db.stud_array.insert({"stud_id" : 1, "semester" : 5, "grades" : [ 90, 90, [92], 92 ] })
Output:
Code #3
db.stud_array.distinct("grades")
Output:
Examples to Implement MongoDB DistinctBelow is the example of a distinct method in MongoDB.
We have taken an example of student_datatable to describe an example of a distinct method is as follows. Below is the data description of the student_data table are as follows.
Example #1use student_data
Example #2db.student_data.find()
1. Return distinct values from fieldThe below example shows that return distinct value from the field. We have used the semester field from the student_data table to describe distinct values from the field.
Code:
db.student_data.distinct ("semester")
Output:
Explanation: In the above example, we have retrieved distinct values from the semester field. The result of values from the customer field is 3, 4, and 5.
2. Return distinct values from fieldThe below example shows that return distinct value from the array field. We have used the grade array field from the student_data table to describe distinct values from the array field.
Code:
db.student_data.distinct ("grades")
Explanation: In the above example, we have retrieved distinct values from the grades field. The above example states that distinct methods in MongoDB consider the array field as each element of the field as a separate value. In the above example output of 92 and 95 occur double because distinct considered it a separate element.
3. Query with a distinct methodThe below example shows that query with the distinct value from the field. We have used semester and grades field from the student_data table to describe queries with distinct fields.
Code:
db.student_data.distinct ("semester",{ grades: 90 })
Output:
4. Using collation with a distinct methodThe below example shows that collation with the distinct method in MongoDB. We have used the semester field from the student_data table to describe collation with the method.
Code:
db.student_data.distinct( "semester", {}, { collation: { locale: "fr", strength: 1 } } )
Output:
Recommended ArticlesThis is a guide to MongoDB Distinct. Here we discuss syntax, parameter, the working of distinct command with examples to implement. You can also go through our other related articles to learn more –
Update the detailed information about How To Calculate Total Assets? With Examples on the Tai-facebook.edu.vn website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!