多维表格
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.5 KiB

"use strict";(self.webpackChunknoco_docs=self.webpackChunknoco_docs||[]).push([[809],{3905:(e,t,r)=>{r.d(t,{Zo:()=>d,kt:()=>c});var a=r(67294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r,a,n={},i=Object.keys(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),u=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},d=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},p="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),p=u(r),m=n,c=p["".concat(s,".").concat(m)]||p[m]||f[m]||i;return r?a.createElement(c,l(l({ref:t},d),{},{components:r})):a.createElement(c,l({ref:t},d))}));function c(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,l=new Array(i);l[0]=m;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o[p]="string"==typeof e?e:n,l[1]=o;for(var u=2;u<i;u++)l[u]=r[u];return a.createElement.apply(null,l)}return a.createElement.apply(null,r)}m.displayName="MDXCreateElement"},30495:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>f,frontMatter:()=>i,metadata:()=>o,toc:()=>u});var a=r(87462),n=(r(67294),r(3905));const i={title:"Formula",description:"This article explains how to create & work with a Formula field.",tags:["Fields","Field types","Formula"],keywords:["Fields","Field types","Formula","Create formula field"]},l=void 0,o={unversionedId:"fields/field-types/formula/formula",id:"fields/field-types/formula/formula",title:"Formula",description:"This article explains how to create & work with a Formula field.",source:"@site/docs/070.fields/040.field-types/060.formula/010.formula.md",sourceDirName:"070.fields/040.field-types/060.formula",slug:"/fields/field-types/formula/formula",permalink:"/fields/field-types/formula/formula",draft:!1,editUrl:"https://github.com/nocodb/nocodb/tree/develop/packages/noco-docs/docs/docs/070.fields/040.field-types/060.formula/010.formula.md",tags:[{label:"Fields",permalink:"/tags/fields"},{label:"Field types",permalink:"/tags/field-types"},{label:"Formula",permalink:"/tags/formula"}],version:"current",sidebarPosition:10,frontMatter:{title:"Formula",description:"This article explains how to create & work with a Formula field.",tags:["Fields","Field types","Formula"],keywords:["Fields","Field types","Formula","Create formula field"]},sidebar:"tutorialSidebar",previous:{title:"JSON",permalink:"/fields/field-types/custom-types/json"},next:{title:"Numeric and Logical Operators",permalink:"/fields/field-types/formula/operators"}},s={},u=[{value:"Create a formula field",id:"create-a-formula-field",level:2},{value:"Supported formula functions",id:"supported-formula-functions",level:2}],d={toc:u},p="wrapper";function f(e){let{components:t,...i}=e;return(0,n.kt)(p,(0,a.Z)({},d,i,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h2",{id:"create-a-formula-field"},"Create a formula field"),(0,n.kt)("ol",null,(0,n.kt)("li",{parentName:"ol"},"Click on ",(0,n.kt)("inlineCode",{parentName:"li"},"+")," icon to the right of ",(0,n.kt)("inlineCode",{parentName:"li"},"Fields header")),(0,n.kt)("li",{parentName:"ol"},"On the dropdown modal, enter the field name (Optional)."),(0,n.kt)("li",{parentName:"ol"},"Select the field type as ",(0,n.kt)("inlineCode",{parentName:"li"},"Formula")," from the dropdown."),(0,n.kt)("li",{parentName:"ol"},"Insert required formula "),(0,n.kt)("li",{parentName:"ol"},"Click on ",(0,n.kt)("inlineCode",{parentName:"li"},"Save Field")," button.")),(0,n.kt)("p",null,(0,n.kt)("img",{alt:"image",src:r(43369).Z,width:"2880",height:"1800"})),(0,n.kt)("admonition",{type:"tip"},(0,n.kt)("ul",{parentName:"admonition"},(0,n.kt)("li",{parentName:"ul"},"You can use explicit numerical values/ strings as needed, e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"123")," (numeric) or ",(0,n.kt)("inlineCode",{parentName:"li"},'"123"')," (string)."),(0,n.kt)("li",{parentName:"ul"},"You can reference field names in equation with ",(0,n.kt)("inlineCode",{parentName:"li"},"{}"),", e.g. ",(0,n.kt)("inlineCode",{parentName:"li"},"{field name}")),(0,n.kt)("li",{parentName:"ul"},"Nested formula (formula equation referring to another formula field) is supported"))),(0,n.kt)("admonition",{type:"note"},(0,n.kt)("p",{parentName:"admonition"},"Unlike other field types, formula cells cannot be modified by double-clicking since the value is generated based on the formula."),(0,n.kt)("img",{width:"253",alt:"image",src:"https://user-images.githubusercontent.com/35857179/189109486-4d41f2b7-0a19-46ef-8bb4-a8d1aabd3592.png"})),(0,n.kt)("h2",{id:"supported-formula-functions"},"Supported formula functions"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/fields/field-types/formula/operators"},"Numeric and Logical Operators")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/fields/field-types/formula/numeric-functions"},"Numeric Functions")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/fields/field-types/formula/string-functions"},"String Functions")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/fields/field-types/formula/date-functions"},"Date Functions")),(0,n.kt)("li",{parentName:"ul"},(0,n.kt)("a",{parentName:"li",href:"/fields/field-types/formula/conditional-expressions"},"Conditional Expressions"))))}f.isMDXComponent=!0},43369:(e,t,r)=>{r.d(t,{Z:()=>a});const a=r.p+"assets/images/formula-f6e9e22e90579dd9f7307338dde8ec07.png"}}]);