LogoLogo
ClausesDatafieldsSpecial FunctionsStylingQ&AAPI
  • Welcome!
  • Getting started
    • What is Clause9?
    • Structuring your clause library
    • Structuring your clauses
    • Drafting modes in Clause9
    • Creating a questionnaire
    • Sample clauses
    • Videos
      • Concepts and datafields
      • Conditions
      • Q&As
      • Binders
      • Styling
      • Enumerations
      • Tables
      • Definitions
      • Snippets
      • Cross-references
      • Special functions
      • Examples of common clauses
      • Import clauses from MS Word
      • Grammatical conjugations
      • Action buttons
      • Alternative clauses
  • Assemble document
    • Document toolbar
    • Clause hierarchies
    • Focus Mode
    • Bulk generation of documents
    • Exporting documents
    • Assemble Document - FAQ
    • How to: Assemble Document
      • Insert images
  • Assemble Document Operations Panel
    • Operations panel
    • File pane
    • Edit pane
    • Document pane
    • Binder pane in the operations panel
    • Search pane
    • Browse pane
    • Terms pane
    • Data dashboard
    • Advanced pane
    • Styling pane
    • Miscellaneous pane
    • Visibility settings & actions menu
  • Binders
    • Binders: general
    • Styling cross-references to subdocuments
    • Global and local definition lists
    • Document and binder properties
    • Styling of a Binder versus subdocuments
    • (Un)locking documents in a binder
    • Binders - FAQ
    • How to: binders
      • Make a subdocument in a binder conditional
  • Clauses
    • Introduction to clauses
    • Clause structure
    • Grammar sheet
    • Writing conditions
    • Examples of conditions
    • Using codes instead of text fragments
    • Bold, italic and underline
    • Special codes
    • Enabled?
    • Links
    • Cross-references
    • Introduction to tables
    • Deviating table styling
    • Shrinking clauses
    • Action buttons
    • Enumerations
    • File position
    • Snippets
    • Parameters
    • Conjugations
    • Mixing data types
    • For-loops
    • Clause versioning
    • Abstract article references
    • Advanced multi-language features
    • Clauses - FAQ
    • How to: clauses
      • Create an ad-hoc clause
      • Create a library clause
      • Make a clause repeat
      • Make a paragraph within a clause conditional
      • Use a shortcut to refer to a concept
      • Insert a line break or page break
      • Creating a list with both predefined options and free input
      • Defining alternative clauses
      • Creating cross-references
      • Creating signature blocks
      • Creating advanced party introduction clauses
      • Automatically numbered annexes or schedules
      • Reuse any clause in a different context
      • Setting MS Word document properties
      • Add action buttons to clauses
      • Electronically signing documents
  • concepts
    • Introduction to concepts
    • Creating concepts
    • Concept labels
    • Links
    • Organising concepts
    • Concepts - FAQ
    • How to: concepts
      • Add predefines to a datafield
  • Datafields
    • Introduction to datafields
    • Types of datafields
    • Rules of thumb for using datafields
    • Data-expressions
    • Datafield aliases
    • Datafield labels
    • Datafield special tags
    • Datafield descriptions
    • Repeating list datafields
    • Datafield predefines
    • Datafields - FAQ
    • How to: datafields
      • Change datafield type
      • Change the datafield's name or alias
  • Definitions
    • Introduction to definitions
    • How to: definitions
      • How do definitions work?
      • Create a definition
  • Files
    • How files are organised
    • Browse files
    • File types
    • Custom styling
    • Legal comments
    • File description
    • Attributes
    • Reporting
    • File name
    • File category
    • Access rights
    • How to: files
      • Creating advanced folders
      • Naming your files
      • Shortcuts to folders or files
  • Q&A
    • About cards
    • Cards pane
    • About changes
    • Changes pane
    • Types of changes
    • Adding conditions
    • Question options
    • Copying & pasting answers
    • Comments, notes & documentation
    • Interactive Q&A inspection
    • Embedding questions into a document
    • “Changes” button
    • Batch create pane
    • Identifiers pane
    • Import pane
    • Edit clauses pane
    • Q&A options
    • Q&A - FAQ
    • How to: Q&A
      • Create predefined answers to a question
      • Add disclaimers
      • Create categories of questions
      • Modify the exported filename
      • Create a question to change the language of a document
      • Send a questionnaire to someone without a ClauseBase account
      • Create questions for repeating list datafields
      • Selecting legal entities & addresses
      • Create a questionnaire using "batch create"
      • Launch other Q&As
    • Leveraging ClauseBuddy Smart Templates in Clause9
  • Import
    • Introduction to importing clauses
    • Uploading clauses
    • Defined terms in Import mode
    • Datafields in Import mode
    • Cross-references in Import mode
    • Assigning folders
    • Conversion process
    • Exporting
    • Stashing intermediate results
    • Tips, tricks & limitations
  • Styling
    • Styling overview
    • Base styling
    • Numbering
    • Definitions styling
    • Enumerations styling
    • Locale styling
    • References styling
    • Page styling
    • Styling of a Binder versus subdocuments
    • Styling: tips and tricks
    • Advanced styling topics
    • Copying headers and footers from an MS Word file
    • How to: styling
      • Using custom fonts
      • Change bullet styling
  • Special functions
    • Introduction
    • Calculations
    • Concepts
    • Conditions
    • Conjugations
    • Content Control Elements
    • Datafields
    • Dates & durations
    • Languages
    • Lists
    • Numbers
    • References
    • Repeating (looping)
    • Special items
    • Text structure
    • Text modification
    • User
    • Q&A
  • Settings
    • Account
    • Preferences
    • Access bundles
    • Favourites
    • Saved searches
    • Saved datafields
    • Styles
    • Default styles
  • Admin
    • General
    • Users
    • User rights
    • Profiles
    • Groups
    • Styles
    • Default styles
    • Attribute models
    • Usage page
    • Custom homepage
    • Global placeholders
    • Access rights
    • How to: admin
      • Adding a new user
      • Disabling a user
      • Managing group memberships
  • Miscellaneous
    • Advanced tips & tricks
    • Typing special symbols on your keyboard
    • Shortcuts
    • Grammar style guide
    • Inserting MS Word files
    • Globo-panel
    • Creating high-quality documents
    • Excel calculations and lookups
  • Integrations
    • Overview
    • Spreadbases
    • E-signing documents
    • Drag & drop integrations
  • For developers
    • Clause9 API
    • Custom functions
    • Example custom functions
Powered by GitBook
On this page
  • @construct-currency
  • @count
  • @difference
  • @intersection
  • @length
  • @lookup
  • @nth
  • @percent-divide
Export as PDF
  1. Special functions

Calculations

@construct-currency

  • first parameter: an amount (e.g., 500 or 5.123)

  • second parameter: USD, EUR, GBP or JPY

Returns a currency value that consists of the specified value and currency.

For example, {@construct-currency(500, "EUR") + 1 EUR} is equal to having typed {500 EUR + 1 EUR}

@count

  • parameter: some list

  • returns a whole number

Returns the number of elements present in the list.

For example, @count(@empty-list) results in 0, while @count(@list(‘alpha’, ‘beta’)) results in 2.

@difference

  • parameters: two lists (the second parameter will be automatically converted to a list)

  • returns a list

Returns the difference between the two lists, i.e. it takes the first list, removes all the elements of the second list that are also present in the first list, and then returns the result.

Examples:

  • @difference(@list(1, 2, 3), @list(1)) results in a list with elements 2 and 3

  • @difference(@list(1, 2, 3), 1) results in a list with elements 2 and 3 — note that the second parameter was automatically converted to @list(1)

  • @difference(@list(1, 2, 3), @list(1, 2, 3)) results in an empty list, because both lists share the same elements

  • @difference(@list(1, 2, 3), @list(1, 1, 2, 2, 3)) also results in an empty list

  • @difference(@list(1, 1, 2, 2, 3, 3), @list(1, 2, 3)) also results in an empty list

  • @difference(@list(1, 1, 2, 2, 3, 3), @list(1, 2)) results in a list with elements 3 and 3

@intersection

  • parameters: two lists (the second parameter will be automatically converted to a list)

  • returns a list

Takes the first list, and removes each element that does not also appear in the second list.

Examples:

  • @intersection(@list(1, 2, 3), @list(3)) will result in a list with element 3

  • @intersection(@list(1, 2, 3), 3) will result in a list with element 3 (note that the second parameter was automatically converted to a list)

  • @intersection(@list(1, 2, 3), @list(1, 2, 3)) will result in a list with elements 1, 2 and 3

  • @intersection(@list(1, 2, 3), @list(4, 5, 6)) will result in an empty list

@length

  • parameter: text

  • returns the number of characters found in the length

Returns the length of the text parameter, taking into account trailing or leading whitespace. For example, @length("alpha") returns 5, while @length(" alpha ") returns 7.

@lookup

  • parameters:

    • value to lookup

    • source-field (of type repeating-field)

    • target-field (of type repeating-field)

  • returns the value of the target-field that corresponds to the value to lookup, otherwise null

For example, assume you have a repeating-list #xxx^first-names and another repeating-list #xxx^last-names. @lookup("Daniel", #xxx^first-names, #xxx^last-names) will then result in the last name of Daniel (if found)

@nth

  • first parameter: a list

  • second parameter: a whole number

Returns the element at the specified index within the (repeating) list.

Returns an error when the index is not found. (If you want a null-value instead, please use @get).

Examples:

  • @nth(@list(100, 200, 300), 1) will result in 100

  • @nth(@list(100, 200, 200), 55) will result in an error (only indices 1, 2 or 3 would be valid)

Note that — unlike most programming languages — the index is one-based, i.e. the first index is one and not zero.

@percent-divide

  • parameters: two numbers

  • returns a number

Divides the first number by the second number, multiplies the result by 100, and returns the final result. Typically used to calculate a percentage.

For example, @percent-divide(5, 20) returns 25,00 — because 5 is 25% of 20.

PreviousIntroductionNextConcepts

Last updated 1 year ago