Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Last 10 days in a graph

I am trying to get another graph to show just the last 10 days of data

My Date field is ReportDate.  The attached seems to bring through every day in 2014 and not just the last 10 days.

ideally I would like to remove the year part so when we are on the 2nd Jan 2015 it will show 8 days worth of December also.

sum({<Year={$(=Max({1}Year))},ReportDate={">=$(=ReportDate(Max(Reportdate)-10)<=$(=ReportDate(Max(ReportDate))))"}>}RenewedCounter)

32 Replies
senpradip007
Specialist III
Specialist III

try this:

sum({<ReportDate={">=$(=ReportDate(Max(Reportdate)-10)<=$(=ReportDate(Max(ReportDate))))"}>}RenewedCounter)

Clever_Anjos
Employee
Employee

There is no ReportDate function

I think this expression could work

sum({<ReportDate={">=$(=Date(Max({1}Reportdate)-10))"}>}RenewedCounter)

Not applicable
Author

this returns no data in the graph

Clever_Anjos
Employee
Employee

There´s a trick to 'debug' a set analysis

Create a straight table with no dimensions and only one expression (that one you want to debug).

Hover your mouse over the expression header, QlikView will evaluate your $ expression.

Please check if it is returning a date

Not applicable
Author

apologies it does work, I just now need to fix it so when I change the list box date fields to an earlier date the graph doesn't go blank

Clever_Anjos
Employee
Employee

You want to respect the list box?

Maybe:

sum({<ReportDate={">=$(=Date(Max(Reportdate)-10))"}*{"<=$(=Date(Max(Reportdate)))"}>}RenewedCounter)

Not applicable
Author

thats handy to know thanks

Not applicable
Author

I was hoping there would be some way of fixing the dates and ignoring other date selections.

for example this fixes 2014, so if I change a list box on app the graph does not change

sum({<Year={$(=Max({1}Year))> RenewedCounter)

I have tried adding the {1} to the formula you have suggested in many ways but with no success i.e.

sum({<ReportDate={">=$(=Date(Max({1}ReportDate)-10))"}*{"<=$(=Date(Max({1}ReportDate)))"}>}RenewedCounter)

MayilVahanan

Hi

Try like this

sum({1<ReportDate={">=$(=Date(Max({1}ReportDate)-10))"}*{"<=$(=Date(Max({1}ReportDate)))"}>}RenewedCounter)


or


sum({1<ReportDate={">=$(=Date(Max({1}ReportDate)-10))<=$(=Date(Max({1}ReportDate)))"}>}RenewedCounter)


And check the dateformat

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.