mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
6.6 KiB
1 lines
6.6 KiB
"use strict";(self.webpackChunknoco_docs=self.webpackChunknoco_docs||[]).push([[800],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>g});var l=n(67294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t){if(null==e)return{};var n,l,o=function(e,t){if(null==e)return{};var n,l,o={},r=Object.keys(e);for(l=0;l<r.length;l++)n=r[l],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(l=0;l<r.length;l++)n=r[l],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=l.createContext({}),p=function(e){var t=l.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},c=function(e){var t=p(e.components);return l.createElement(i.Provider,{value:t},e.children)},s="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return l.createElement(l.Fragment,{},t)}},m=l.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,i=e.parentName,c=u(e,["components","mdxType","originalType","parentName"]),s=p(n),m=o,g=s["".concat(i,".").concat(m)]||s[m]||d[m]||r;return n?l.createElement(g,a(a({ref:t},c),{},{components:n})):l.createElement(g,a({ref:t},c))}));function g(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,a=new Array(r);a[0]=m;var u={};for(var i in t)hasOwnProperty.call(t,i)&&(u[i]=t[i]);u.originalType=e,u[s]="string"==typeof e?e:o,a[1]=u;for(var p=2;p<r;p++)a[p]=n[p];return l.createElement.apply(null,a)}return l.createElement.apply(null,n)}m.displayName="MDXCreateElement"},87956:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>a,default:()=>d,frontMatter:()=>r,metadata:()=>u,toc:()=>p});var l=n(87462),o=(n(67294),n(3905));const r={title:"Rollup",description:"Understanding Rollup Column!"},a=void 0,u={unversionedId:"setup-and-usages/rollup",id:"version-0.109.7/setup-and-usages/rollup",title:"Rollup",description:"Understanding Rollup Column!",source:"@site/versioned_docs/version-0.109.7/030.setup-and-usages/080.rollup.md",sourceDirName:"030.setup-and-usages",slug:"/setup-and-usages/rollup",permalink:"/0.109.7/setup-and-usages/rollup",draft:!1,editUrl:"https://github.com/nocodb/nocodb/tree/develop/packages/noco-docs/docs/versioned_docs/version-0.109.7/030.setup-and-usages/080.rollup.md",tags:[],version:"0.109.7",sidebarPosition:80,frontMatter:{title:"Rollup",description:"Understanding Rollup Column!"},sidebar:"tutorialSidebar",previous:{title:"Lookup",permalink:"/0.109.7/setup-and-usages/lookup"},next:{title:"Formulas",permalink:"/0.109.7/setup-and-usages/formulas"}},i={},p=[{value:"Rollup",id:"rollup",level:2},{value:"RollUp AGGREGATION functions supported",id:"rollup-aggregation-functions-supported",level:3},{value:"Adding a rollup column",id:"adding-a-rollup-column",level:2},{value:"1. Add new column",id:"1-add-new-column",level:4},{value:"2. Feed column name",id:"2-feed-column-name",level:4},{value:"3. Select Column type as 'Rollup'",id:"3-select-column-type-as-rollup",level:4},{value:"4. Choose Child Table",id:"4-choose-child-table",level:4},{value:"5. Choose on \u200bChild column",id:"5-choose-on-child-column",level:4},{value:"6. Select \u200bAggregate function",id:"6-select-aggregate-function",level:4},{value:"7. Click on Save",id:"7-click-on-save",level:4}],c={toc:p},s="wrapper";function d(e){let{components:t,...n}=e;return(0,o.kt)(s,(0,l.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"rollup"},"Rollup"),(0,o.kt)("p",null,"Sample Organization structure:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"5 Departments, each department has a team name & associated team code"),(0,o.kt)("li",{parentName:"ul"},"5 employees working at different Departments"),(0,o.kt)("li",{parentName:"ul"},"Teams ",(0,o.kt)("strong",{parentName:"li"},"has many")," Employees : relationship has been defined")),(0,o.kt)("p",null,(0,o.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/86527202/189296162-536185f1-31ed-40df-b668-deed7ad630aa.png",alt:"Screenshot 2022-09-09 at 12 57 32 PM"})),(0,o.kt)("h3",{id:"rollup-aggregation-functions-supported"},"RollUp AGGREGATION functions supported"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Count"),(0,o.kt)("li",{parentName:"ul"},"Minimum"),(0,o.kt)("li",{parentName:"ul"},"Maximum"),(0,o.kt)("li",{parentName:"ul"},"Average"),(0,o.kt)("li",{parentName:"ul"},"Sum"),(0,o.kt)("li",{parentName:"ul"},"Count Distinct"),(0,o.kt)("li",{parentName:"ul"},"Sum Distinct"),(0,o.kt)("li",{parentName:"ul"},"Average Distinct")),(0,o.kt)("p",null,"Now, we can explore how to extract employee count information per team using ",(0,o.kt)("strong",{parentName:"p"},'"ROLLUP"')," columns"),(0,o.kt)("h2",{id:"adding-a-rollup-column"},"Adding a rollup column"),(0,o.kt)("h4",{id:"1-add-new-column"},"1. Add new column"),(0,o.kt)("p",null,"Click on '+' icon to the left of column headers in Departments table"),(0,o.kt)("h4",{id:"2-feed-column-name"},"2. Feed column name"),(0,o.kt)("h4",{id:"3-select-column-type-as-rollup"},"3. Select Column type as 'Rollup'"),(0,o.kt)("h4",{id:"4-choose-child-table"},"4. Choose Child Table"),(0,o.kt)("p",null,"Table Employee in our example"),(0,o.kt)("h4",{id:"5-choose-on-child-column"},"5. Choose on \u200bChild column"),(0,o.kt)("p",null,"Pick appropriate column for aggreagation"),(0,o.kt)("h4",{id:"6-select-aggregate-function"},"6. Select \u200bAggregate function"),(0,o.kt)("p",null,'Aggregate function will be "count" in our case'),(0,o.kt)("h4",{id:"7-click-on-save"},"7. Click on Save"),(0,o.kt)("p",null,(0,o.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/86527202/189297619-4d5c815b-6c97-41fa-978e-9b645448e508.png",alt:"Screenshot 2022-09-09 at 1 03 49 PM"})),(0,o.kt)("p",null,"Column ",(0,o.kt)("inlineCode",{parentName:"p"},"Employee Count")," is populated with appropriate information"),(0,o.kt)("p",null,(0,o.kt)("img",{parentName:"p",src:"https://user-images.githubusercontent.com/35857179/194856842-e35a6424-fb95-4805-8efa-a559563e4b71.png",alt:"image"})))}d.isMDXComponent=!0}}]); |