Looker Studio Function : SIN
Category: Arithmetic function
The SIN function in Looker Studio is a mathematical function used to return the sine of a numeric value, commonly expressed in radians. It is primarily used in data distribution analysis, customer segmentation, and decision-making processes. By applying SIN in calculated fields, users can better model cyclical behaviors or trends in datasets.
Purpose of the SIN Function
1. Data Distribution Analysis :
The SIN function helps model cyclical data patterns, especially when working with periodic data like seasonal trends or waveforms. Analysts can simulate patterns or check distributions across time or category dimensions.
2. Customer Segmentation :
Segment customers based on behaviors that follow a cyclic pattern—like time of day, day of the week, or seasonal purchase behavior—by applying the SIN function to time-based data.
3. Decision Making :
Use the SIN function to support smarter decisions by identifying predictable cycles. When combined with other functions, it enhances strategic choices in inventory planning, marketing, and forecasting.
Type of Calculation:
| Use Case | Description |
|---|---|
| Performance Benchmark | Analyze patterns in metrics over time to identify seasonal highs/lows.. |
| Customer Segmentation | Detect repeating behaviors for better targeting using time-based patterns. |
| Time Series Analysis | Identify cyclical trends and seasonality in time series datasets. |
SIN(X)
| Parameter | Type | Description |
|---|---|---|
number | Number | A numeric value in radians to evaluate |
How Does the SIN Function Work?
The SIN function calculates the sine of a number (angle in radians). It runs using the underlying mathematical sine function (sin(x)), producing values from -1 to 1. It is most effective when used with cyclical or periodic data, especially date-time fields converted into radians.
When Should You Use SIN Function?
Use the SIN function when:
Modeling seasonal or cyclical trends
Creating normalized signals from date/time fields
Applying mathematical transformations in custom calculated fields
Example of SIN with Result
SIN(PI()/2)
Result: 1
This expression calculates the sine of 90 degrees (or π/2 radians), returning the maximum sine value.
Example 1: Basic Usage
ROUND(99.875, 1) → 99.9
Example 2: Column Usage
Use SIN in a calculated field:
SIN(TO_RADIANS(Hour))
Example 3: Handling Decimals and Scientific Notation
The SIN function supports:
Decimal numbers (e.g.,
SIN(1.57))Scientific notation (e.g.,
SIN(3.1415e0))
Example 4: Combining with Other Functions
SIN(TO_RADIANS(HOUR(TIMESTAMP)))
Tips and Tricks
Combine SIN with TO_RADIANS for accurate trigonometric calculations.
Use with custom time dimensions for detailed segmentation.
Normalize results for machine learning input features.
Test with different intervals to identify wave patterns in your data.
Yes, convert date parts (like hours or days) into radians for accurate SIN analysis.
It returns a value between -1 and 1, depending on the input angle (in radians).
To detect cyclical customer behaviors such as weekly or daily buying patterns.
Less so. SIN is best used when modeling cycles, which often rely on time-related inputs.
Ensure values are in radians, not degrees, before applying the SIN function.