Skip to main content

inflectNoun

Returns the inflected form of a noun.

Parameters

  • WORD (string)

    The input noun.

  • COUNT (string or number)

    The input count. Specify singular or plural, or enter a number.

Notes

  • The function can handle most multi-word noun phrases.

  • Spaces or hyphens in the input noun are replicated in the output.

  • The most common input to COUNT is an ATL expression that returns a number.

Examples

ATL in Script

Result

[[inflectNoun('whiskies', 'singular')]]

whisky

[[inflectNoun('whisky', 'plural')]]

whiskies

[[inflectNoun('whiskies', 1)]]

whisky

[[inflectNoun('whisky', 12)]]

whiskies

[[inflectNoun('whisky', 0)]]

whiskies

Note

The noun is returned in plural form when COUNT = 0.

The function can handle most multi-word noun phrases.

ATL in Script

Result

[[inflectNoun('single malt whiskies', 'singular')]]

single malt whisky

[[inflectNoun('single malt whisky', 'plural')]]

single malt whiskies

[[inflectNoun('line-of-business', 'plural')]]

lines-of-business

Using an ATL expression in the COUNT parameter

The examples so far have specified singular or plural, or given a number. However, the most common input to the COUNT parameter is an ATL expression — e.g. a variable or function call — that returns a number.

Assume a "Describe Each Row" project with this data:

Code

Product

UnitsSold

Target

Row 1

1001

Balblair

1

2

Row 2

1002

Laphroaig

4

3

Row 3

1003

Rosebank

0

2

In this example the input to the COUNT parameter is the UnitsSold variable:

We sold [[numToWords(UnitsSold,'','','no')]] [[inflectNoun('unit', UnitsSold)]] of [[Product]]. 

The results for each row are:

Row 1 Result

Row 2 Result

Row 3 Result

We sold one unit of Balblair.

We sold four units of Laphroaig.

We sold no units of Rosebank.