10 Replies Latest reply: Jun 18, 2015 5:43 AM by AVIRAL NAG

# 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.

Kind Regards,

Hasvine

• ###### Re: Pull data for the last 7 days in Dimension

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

then check the box "Suppress Null Values"

let me know

• ###### Re: Pull data for the last 7 days in Dimension

Hi Alessandro,

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

• ###### Re: Pull data for the last 7 days in Dimension

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

• ###### Re: Pull data for the last 7 days in Dimension

Instead of using the Date Logic in Dimension use it in the Expression Level.

Like this:

Sum({<NewDate={'>=\$(vStartDate)<=\$(vEndDate)'}>} Value)

Where vStartDate and vEndDate are Variables

vStartDate=Date(Today()-7)

vEndDate=Date(Today())

Regards

Av7eN

• ###### Re: Pull data for the last 7 days in Dimension

Hello,

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

Cheers,
V.

• ###### Re: Pull data for the last 7 days in Dimension

Try this:

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

• ###### Re: Pull data for the last 7 days in Dimension

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

• ###### Re: Pull data for the last 7 days in Dimension

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:

Regards

Av7eN

• ###### Re: Pull data for the last 7 days in Dimension

Hi Avee,

It works fine now.

Thanks guys,

Hasvine

• ###### Re: Pull data for the last 7 days in Dimension

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.