Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Highlighted

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)
Highlighted
Partner
Partner

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.

Highlighted

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)
Highlighted
Creator II
Creator II

Try below one

Sum({$<

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

Highlighted

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)