Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I don't unsterdant why it doesn't work
if ( [AnnéeMois2] > '31/12/2022',
(RangeSum(above(If([Unité de commande] = 'pièce', Sum( {< Année={"$(=YearName(Max(Date)))"}>} [m3/ pièce]* [QTÉ CMDE]), Sum({< Année={"$(=YearName(Max(Date)))"}>} [QTÉ CMDE])),0,RowNo(Total))))
,
(RangeSum(above(If([Unité de commande] = 'pièce', Sum( {< Année={"$(=YearName(Max(Date),-1))"}>} [m3/ pièce]* [QTÉ CMDE]), Sum({< Année={"$(=YearName(Max(Date),-1))"}>} [QTÉ CMDE])),0,RowNo(Total)))
))
It's OK
if ( [AnnéeMois2] > YearEnd(max([AnnéeMois2]),-1),
(RangeSum(above(If([Unité de commande] = 'pièce', Sum( {< Année={"$(=YearName(Max(Date)))"}>} [m3/ pièce]* [QTÉ CMDE]), Sum({< Année={"$(=YearName(Max(Date)))"}>} [QTÉ CMDE])),0,RowNo(Total))))
,
(RangeSum(above(If([Unité de commande] = 'pièce', Sum( {< Année={"$(=YearName(Max(Date),-1))"}>} [m3/ pièce]* [QTÉ CMDE]), Sum({< Année={"$(=YearName(Max(Date),-1))"}>} [QTÉ CMDE])),0,RowNo(Total)))
))
It's not OK
But YearEnd(max([AnnéeMois2]),-1) =
Hi there!
To understand the issue, you should understand that your expression is being evaluated in the context of your chart dimensions. It looks like your chart dimension is related to dates - either a date, or a week, or a month... For each value of that dimension, the max(year) will be potentially different, hence the issue.
You can try one of the two solutions:
1. You can add the keyword TOTAL to your YearEnd calculation:
if ( [AnnéeMois2] > YearEnd(max( TOTAL [AnnéeMois2]),-1), ...
and that should disregard the impact of dimensionality
2. Or, you can pre-calculate the desired value in a variable. Create a variable with the following definition:
vYearEnd1 = "=YearEnd(max( TOTAL [AnnéeMois2]),-1)"
That will get calculated once, outside of your chart, and then in the chart expression, you can use it like this:
if ( [AnnéeMois2] > '$(vYearEnd1 )', ...
Both solutions should work. The first is easier to implement, while the second could improve performance, if that's a concern. Good luck!
To learn more advanced development techniques, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin!
Hi there!
To understand the issue, you should understand that your expression is being evaluated in the context of your chart dimensions. It looks like your chart dimension is related to dates - either a date, or a week, or a month... For each value of that dimension, the max(year) will be potentially different, hence the issue.
You can try one of the two solutions:
1. You can add the keyword TOTAL to your YearEnd calculation:
if ( [AnnéeMois2] > YearEnd(max( TOTAL [AnnéeMois2]),-1), ...
and that should disregard the impact of dimensionality
2. Or, you can pre-calculate the desired value in a variable. Create a variable with the following definition:
vYearEnd1 = "=YearEnd(max( TOTAL [AnnéeMois2]),-1)"
That will get calculated once, outside of your chart, and then in the chart expression, you can use it like this:
if ( [AnnéeMois2] > '$(vYearEnd1 )', ...
Both solutions should work. The first is easier to implement, while the second could improve performance, if that's a concern. Good luck!
To learn more advanced development techniques, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin!
You're so strong , thank you very much !!!