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

Rolling 30 days avg

Hi,

I have filters Date, Month, Year.

Taken date in X-axis and written the expression for rolling 30 days.

when I am selecting date, it is displaying that particular date only not previous 30 day.

please find the expression

Avg({<Day={">=$(=Date(max(Day)-30,'MM/DD/YYYY'))<=$(=Date(max(Day),'MM/DD/YYYY'))"}>}AssetRank)

could you suggest any mistakes I have done in this expression.

19 Replies
rodrigomartinez
Contributor
Contributor

Please test this mode.

Variables

vMaxDate = Max(Day)

vMinDate = Date(Max(Day) - 30)

Formula:

AVG({<Day = {">=$(=$(vMinDate ))<=$(=$(vMaxDate )) "}>}AssetRank).

sunny_talwar

I think you need to ignore selection in Date, Year and Month field and assuming Day looks like this 07/12/2016 (full date), it will drive all your selections

Avg({<Day={">=$(=Date(max(Day)-30,'MM/DD/YYYY'))<=$(=Date(max(Day),'MM/DD/YYYY'))"}, Date, Month, Year>}AssetRank)

Not applicable
Author

Hi Sunny,

thanks for your reply.

I have applied your expression still it is not working. whatever values I am selecting simply it is displaying that values only

dimension is in this below format.

Date(Day,'MMDD')

sunny_talwar

What is the difference between Date and Day?

Not applicable
Author

Date column is not there, y mistake instead of Day I mentioned Date.

sunny_talwar

Can you share a sample?

Not applicable
Author

Hi Sunny,

Please find the attached sample data.

sunny_talwar

This looks like an export from QlikView? Raw data or just the QVW app?

Not applicable
Author

Hi Sunny,

Now I have attached the sample data. please find it.