Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

pedlopes
New Contributor III

Aggregate value for 7 days after date selected

Hi guys,

I have information about about nº of downloads by date. On my Dashboard i have a table with DATE and Nº OF DOWNLOADS, and i have a filter DATE too.

My question is. It is possible create a expression too wen i select some date, my output be the aggregation from Nº OF DOWNLOADS 7 days  starting DATE selected.

Exemple:

I select date '2016-06-05' and the output is


sum( {<DATE={'2016-06-05'+'2016-06-06'+.........+'2016-06-07'}>} Nº OF DOWNLOADS)

Thanks in advance,

Pedro Lopes

6 Replies

Re: Aggregate value for 7 days after date selected

May be try

=sum( {<DATE={'>=$(=DATE)<=$(=Date(DATE+7))'}>} [Nº OF DOWNLOADS])

Re: Aggregate value for 7 days after date selected

Not sure how the environmental variables are set, I would just suggest one change:

=Sum({<DATE={'>=$(=Date(Max(DATE), 'YYYY-MM-DD'))<=$(=Date(Max(DATE)+7, 'YYYY-MM-DD'))'}>} [Nº OF DOWNLOADS])

pedlopes
New Contributor III

Re: Aggregate value for 7 days after date selected

This expression only give me the value from selected day.

Re: Aggregate value for 7 days after date selected

Are you making selection in DATE field? or is there another field you are making selection in?

pedlopes
New Contributor III

Re: Aggregate value for 7 days after date selected

Yes, i only have a data field to make selection. 

Example:

A DATA filter and a table with DATA, NAME of PRODUCT and N OF DOWNLOADS.

pedlopes
New Contributor III

Re: Aggregate value for 7 days after date selected

Sorry DATA means DATE