Skip to content
Reference > Prepare Methods

dnorm(value)

Definition

Double dnorm(Number value)

Description

similar to stack, but scaled so that the min value is zero. Short hand for: (stack(value) - value)/sum(value). This, in conjunction with norm(...) can used for preparing area charts that should fill an area, such as a pie chart.

Parameter Definition

Name Type Description
value Number

Example

Prepare *,dnorm(Price) as Sample from SampleData Partition by Symbol
+------+--------+-----+-------------------+
|Symbol|Sequence|Price|Sample             |
+------+--------+-----+-------------------+
|CAT   |1       |50.0 |0.0                |
|CAT   |2       |54.0 |0.18867924528301888|
|CAT   |3       |52.0 |0.39245283018867927|
|CAT   |4       |52.0 |0.5886792452830188 |
|CAT   |5       !null !null               |
|CAT   |6       |57.0 |0.7849056603773585 |
|IBM   |1       |20.0 |0.0                |
|IBM   |2       |24.0 |0.21505376344086022|
|IBM   |3       |22.0 |0.4731182795698925 |
|IBM   |4       |27.0 |0.7096774193548387 |
|IBM   |5       !null !null               |
+------+--------+-----+-------------------+