Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pull data for the last 7 days in Dimension

Hello All,

I am trying to pull out only the last 7 days in a calculated dimension and it says the expression is OK but it does not give me any data.

Below is my calculated dimension:

=if(Date >= today()-7 and Date = today(), Date)

Date is my field name for date.

Thanks for your help.

Kind Regards,

Hasvine

10 Replies
alexandros17
Partner - Champion III
Partner - Champion III

=if(Date >= today()-7 and Date <= today(), Date, null())

then check the box "Suppress Null Values"

let me know

aveeeeeee7en
Specialist III
Specialist III

Hi

Use this:

=if(Date>= today()-7 and Date<= today(), Date)

Use this in Dimension and after doing this check the Suppress when Value is Null Option.

See This:

Suppress Today-7.png

Regards

Av7eN

Not applicable
Author

Hi Alessandro,

Thank you for your quick reply.

It works but the i get numerical values such as 42166,177271412

As the expression is in the Dimension tab, I can't change it in the 'Number' tab. 😞

KR,

Hasvine

Not applicable
Author

Hi Avee,

It works fine now.

Thanks guys,

Hasvine

aveeeeeee7en
Specialist III
Specialist III

Use the Date Format in the Front end if you are getting Numerical date Values.

=Date(if(Date >= today()-7 and Date <= today(), Date, null()),'DD/MM/YYYY')

Regards

Av7eN

Not applicable
Author

Hi,

If you want to check on today then create one variable,using peek i.e,vMax , then put dimension as

=if(Date >= today()-7 and today()='$(vMax)',Date,null())

And suppress null values.

vishsaggi
Champion III
Champion III

Hello,

Could you upload a sample qvw file if possible so that we can look into.

Cheers,
V.

Not applicable
Author

Try this:

=if(Date >= today()-7 and Date <= today(), Date(Date,'DD-MM-YYYY'), null())

alexandros17
Partner - Champion III
Partner - Champion III

If the question is closed please mark the answers to close the discussion