Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Partner
Partner

Set Analysis Date range doesn't work when we select a date?

Hi all,

I have used the below expression to calculate the amount starting from financial year to this date. But, When I try to change the date in the filters, the below expression doesn't work.

For example;

If I select date as 01/05/2017 in the filter, The report should list the values starting from 01/04/2017 to 01/05/2017 but instead it calculates all the values from 01/04/2017 to today.

I have used the below expression in my report;

=Sum({<Dim_Date={'>=$(=YearStart(Max(Dim_Date),0,4)) <=$(=Max(Dim_Date)))'}>}Amount)

What so strange here is when I put the start date in one text box and end date expression in one text box and then I select the date in filters, The dates are changing in the text boxes.

Please help me to fix this issue.

5 Replies

Re: Set Analysis Date range doesn't work when we select a date?

You must declare the Variable name like

=Sum({<Dim_Date={'>=$(=YearStart(Max(Dim_Date),0,4)) <=$(DateRangeVariableName)'}>}Amount)


OR


=Sum({<Dim_Date={'>=$(=YearStart(Max(Dim_Date),0,4)) <=$(=Max(Dim_Date)))'}>}Amount)

May be one extra parenthesis written


Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Partner
Partner

Re: Set Analysis Date range doesn't work when we select a date?

Hi Anil,

Thanks for the reply.Again I'm having the same problem. Is there any other simpler way to solve this. The Date inside the expression should change as I change the date in the filters, Also the year function too should work.

Re: Set Analysis Date range doesn't work when we select a date?

Can you please attach work file to test

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
lakkydev
Contributor II

Re: Set Analysis Date range doesn't work when we select a date?

Try below one

Sum({$<

Dim_Date={">=$(=MonthStart(AddMonths(Max(Dim_Date),-1)))<$(=MonthEnd(Max(Dim_Date)))"}>}Amount)

Re: Set Analysis Date range doesn't work when we select a date?

How about if you use Date() function

=Sum({<Dim_Date = {"$(='>=' & Date(YearStart(Max(Dim_Date), 0, 4), 'DD/MM/YYYY') & '<=' & Date(Max(Dim_Date), 'DD/MM/YYYY'))"}>} Amount)