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: 
Anonymous
Not applicable

Chart line stop at current month

I am struggling with this problem for days now, hopefully somebody can help me with this problem. I have a chart with 3 lines to compare the sales with the sales a year before. When I compare the sales off this year with the sales last year I want to stop the line at current month. Does somebody know how I can do this?

The expression I use:

2017 vs 2018    sum({1<  Year = {2018} >}Sales) - sum({1< Year = {2017} >}Sales)

2016 vs 2017    sum({1<  Year = {2017} >}Sales) - sum({1< Year = {2016} >}Sales)

2015 vs 2016    sum({1<  Year = {2016} >}Sales) - sum({1< Year = {2015} >}Sales)

3 Replies
tomer1984
Contributor III
Contributor III

HI Rakis

I think you can use Year to Date function  to create a field

to compare the time pass from the start of the year till the current  day

The user will have to select YTD and the 2 years

Example in the script :

If(inyeartodate( Date, today(), year(Date)-year(Today())),'YTD',NULL()) AS YearToDate,

Hope it helps

Tomer Biran

sunny_talwar

Check the attached

Capture.PNG

StevePaulich
Contributor II
Contributor II

IN THE EXPRESSION:

=IF([PERIOD_CHECK] < [MAX_PERIOD_CHECK], SUM(X))

**************************************************************************
WHERE PERIOD_CHECK = YYYYMM (TRANSACTIONAL DATE)
MAX_PERIOD_CHECK = YYYYMM (DATE TO STOP DISPLAYING LINE)