Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YearToDate Chart

Hello, I have a problem to make a chart with a ytd expression against a period dimension when I use the product dimension it works right.

I made an example in QV, can anyone help me out here?

error loading image

Thnx in advance!

1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

Hello,

In a table expression, you can't refer to values outside each row without using inter-row functions. Change your expression to the following and it will work:

rangeavg(above(
IF(InYearToDate(KEY_DATE,'01-'&PERIOD&'-'&PIT_YEAR,0), AMOUNT)
,0,11)
)

Regards.

View solution in original post

3 Replies
pover
Partner - Master
Partner - Master

Hello,

In a table expression, you can't refer to values outside each row without using inter-row functions. Change your expression to the following and it will work:

rangeavg(above(
IF(InYearToDate(KEY_DATE,'01-'&PERIOD&'-'&PIT_YEAR,0), AMOUNT)
,0,11)
)

Regards.

Not applicable
Author

That's a solution, the formula should be;

rangeavg(above(
IF(InYearToDate(KEY_DATE,'01-'&PERIOD&'-'&PIT_YEAR,0), AMOUNT)
,0,12)
)

Another solution is to make a new time table called 'CHARTTIMETABLE' and put the PERIOD field of this table in the dimension, see attached file.

pover
Partner - Master
Partner - Master

Yeap, using a date island table is also a solution. Just be aware that that solution does not scale well when you have a large volumn of data.

Regards.