Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Previoues Year value showing wrong

Hi All,

I am trying to display current yr & previous value in Text object like below with current yr Selection(2018) value is correct but 2017 value not correct.

Capture.PNG

With 2017 Year selection its showing correct value=648

Capture1.PNG

Text object expression is :

=Max(Year) & ': ' & Num(Count({<Year=, Quarter=, Month=, DateType={'Opened'},Incident_problem= {'Problem'}, Date={">=$(=YearStart(Max(Date))) <=$(=Max(Date))"}>}number), '#,##0')

& Chr(10) & (Max(Year)-1) & ': ' & Num(Count({<Year=, Quarter=, Month=, DateType={'Opened'},Incident_problem= {'Problem'}, Date={">=$(=YearStart(AddYears(Max(Date), -1))) <=$(=AddYears(Max(Date), -1))"}>}number), '#,##0')

Can any one suggest where i am doing wrong.

Thanks

Rajesh

1 Solution

Accepted Solutions
Highlighted

Re: Previoues Year value showing wrong

May be try this

=Max(Year) & ': ' & Num(Count({<Year=, Quarter=, Month=, DateType={'Opened'},Incident_problem= {'Problem'}, Date={">=$(=YearStart(Max(Date))) <=$(=Max(Date))"}>}number), '#,##0')

& Chr(10) & (Max(Year)-1) & ': ' & Num(Count({<Year=, Quarter=, Month=, DateType={'Opened'},Incident_problem= {'Problem'}, Date={">=$(=YearStart(AddYears(Max(Date), -1)))<$(=YearStart(Max(Date)))"}>}number), '#,##0')

View solution in original post

4 Replies
Highlighted

Re: Previoues Year value showing wrong

May be try this

=Max(Year) & ': ' & Num(Count({<Year=, Quarter=, Month=, DateType={'Opened'},Incident_problem= {'Problem'}, Date={">=$(=YearStart(Max(Date))) <=$(=Max(Date))"}>}number), '#,##0')

& Chr(10) & (Max(Year)-1) & ': ' & Num(Count({<Year=, Quarter=, Month=, DateType={'Opened'},Incident_problem= {'Problem'}, Date={">=$(=YearStart(AddYears(Max(Date), -1)))<$(=YearStart(Max(Date)))"}>}number), '#,##0')

View solution in original post

Highlighted
Creator II
Creator II

Re: Previoues Year value showing wrong

Thanks bro..

its working

Highlighted
Creator II
Creator II

Re: Previoues Year value showing wrong

Hi Sunny,

In which scenario we should write this

Date={">=$(=YearStart(AddYears(Max(Date), -1))) <=$(=AddYears(Max(Date),-1))"}

Highlighted

Re: Previoues Year value showing wrong

If you want to show YTD previous year....