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 next

This example demonstrate the following comparison functions.

In this example, the dataset contains current measurements of the sides of rectangular areas next to the size of those areas as previously reported. Using these functions, you can perform some light analysis of the data.

Source:

sideAsideBreportedArea
41456
6635
8432
1515200
4728
12670
9981

Transformation:

In the first test, you are determining if the four-sided area is a square, based on a comparison of the measured values for sideA and sideB:

D trans
RawWrangletrue
p03Value'isSquare'
Typestep
WrangleTextderive type:single value:EQUAL(sideA, sideB) as:'isSquare'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueEQUAL(sideA, sideB)
p03NameNew column name
SearchTermNew formula

Next, you can use the reported sides to calculate the area of the shape and compare it to the area previously reported:

D trans
RawWrangletrue
p03Value'isValidData'
Typestep
WrangleTextderive type:single value:NOTEQUAL(sideA * sideB, reportedArea) as:'isValidData'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueNOTEQUAL(sideA * sideB, reportedArea)
p03NameNew column name
SearchTermNew formula

You can also compute if the reportedArea can be divided into even square units:

D trans
RawWrangletrue
p03Value'isReportedAreaEven'
Typestep
WrangleTextderive type:single value:ISEVEN(reportedArea) as:'isReportedAreaEven'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueISEVEN(reportedArea)
p03NameNew column name
SearchTermNew formula

You can test if either measured side is an odd number of units:

D trans
RawWrangletrue
p03Value'isSideOdd'
Typestep
WrangleTextderive type:single value:IF((ISODD(sideA) == true) OR (ISODD(sideB) == true),TRUE,FALSE) as:'isSideOdd'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueIF((ISODD(sideA) == true) OR (ISODD(sideB) == true),TRUE,FALSE)
p03NameNew column name
SearchTermNew formula

Results:

sideAsideBreportedAreaisSquareisValidDataisReportedAreaEvenisSideOdd
41456FALSEFALSETRUEFALSE
6635TRUETRUETRUEFALSE
8432FALSEFALSETRUEFALSE
1515200TRUETRUETRUETRUE
4728FALSEFALSETRUETRUE
12670FALSETRUETRUEFALSE
9981TRUEFALSEFALSEFALSE