Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

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

aveeeeeee7en
Valued Contributor III

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:

Suppress Today-7.png

Regards

Av7eN

Not applicable

Re: Pull data for the last 7 days in Dimension

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

Re: Pull data for the last 7 days in Dimension

Hi Avee,

It works fine now.

Thanks guys,

Hasvine

aveeeeeee7en
Valued Contributor III

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

Not applicable

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.

vishsaggi
Esteemed Contributor III

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.

Not applicable

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

Community Browser