---
title: WEEKNUM
description: Learn how to use the WEEKNUM function to calculate and analyze week numbers from dates, enhancing your time-based data analysis and reporting
---
import { Aside ,Steps} from '@astrojs/starlight/components';

# WEEKNUM

The WEEKNUM function in Infoveave returns the day of the week as text for a given date.

## Applicable to

Calculated Columns

## Return Value

The function returns the week number of the date as an integer value.

## Remark

* The WEEKNUM function helps analyze date-related data by breaking down the week number, crucial for time-based data analysis and reporting.
* The WEEKNUM function does not consider nulls or blanks.

## Syntax

```
WEEKNUM(<expression>)
```

<br/>

<Aside type="tip">
You can call in the system defined date function start date and end date as `@StartDate` and `@EndDate` respectively.
</Aside>

<br/>

## WEEKNUM in Calculated Columns

Write the WEEKNUM function. For instance

```
WEEKNUM(<expression>)
```

<Steps>
1. Replace `<expression>` with the start period. You can also call in `@StartDate` and `@EndDate` function.
2. To learn how to add calculated columns in Infoveave, visit the section [Calculated Columns](/studio-v8/datasources/calculated-columns-datasource/).
</Steps>

<br/>

**Example**

Suppose you want to create a column that returns the week number based on the column SALES DATE, you can use the WEEKNUM function as follows

```
WEEKNUM(DATEVALUE(VALUE([Sales Date])))
```

<br/>

<Aside type="tip">
When using the DATE function within WEEKNUM, you do not need to include the function DATEVALUE in your formula.

For example

```
WEEKNUM((DATE(2024, 05, 01))) 
```

will return Wednesday.
</Aside>
<br/>


