Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version r0811

D toc

Excerpt

Returns the least common multiple shared by the first and second arguments.

  • Each argument can be a literal Integer number, a function returning an Integer, or a reference to a column containing Integer values.

D s lang vs sql

D s
snippetBasic

D lang syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value: lcm(10,4) as:'twenty'

lcm(10,4)

Output: Returns the least common multiple between values 10 and 4, which is 20

D s
snippetSyntax

D lang syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:lcm(value1, value2)

lcm(value1, value2)


ArgumentRequired?Data TypeDescription
value1YstringThe first value must be an Integer literal, column reference, or expression that evaluates to an Integer value.
value2YstringThe first value must be an Integer literal, column reference, or expression that evaluates to an Integer value.

D s lang notes

value1, value2

Integer expressions, column references or literals to multiply together.

  • Missing or mismatched values generate missing string results. 

D s
snippetusage

Required?Data TypeExample Value
YesLiteral, function, or column reference returning an Integer value15


D s
snippetExamples

Example - Basic LCM function

Source:

stringrepeat_count
ha0
ha1
ha1.5
ha2
ha-2


Transformation:

D trans
RawWrangletrue
p03Value'repeat_string'
Typestep
WrangleTextderive type:single value: repeat(string, repeat_count) as: 'repeat_string'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuerepeat(string, repeat_count)
p03NameNew column name
SearchTermNew formula

Results:

stringrepeat_countrepeat_string
ha0 
ha1ha
ha1.5 
ha2haha
ha-2 


D s also
labelmath