Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Rajesh
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
sunny_talwar

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
sunny_talwar

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')

Rajesh
Creator II
Creator II
Author

Thanks bro..

its working

Rajesh
Creator II
Creator II
Author

Hi Sunny,

In which scenario we should write this

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

sunny_talwar

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