Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Currently I am making an expression where the "default values" must be both Euro & RY (Rolling year). This expression works:
=if(vCurrency = 'EUR' and GetSelectedCount(MonthYear) = 0,
num(
sum({< RY = {'1'}>}[#LinetotAfterDiscount]),
only( {< CurrencyCode = {'EUR'} >} CurrencyFormat0Decimals)),
num(
(sum( {< CURRID = {$(vCurrency)} >} [#LclLinetotAfterDiscount]) + sum( {< CURRID -= {$(vCurrency)} >}[#LinetotAfterDiscount] / $(vCurrency))),
only( {< CurrencyCode = {$(vCurrency)} >} CurrencyFormat0Decimals)
)
)
When a currency other than euro is selected, it automatically moves to the bottom half of the expression.
The problem: RY is not included in the bottom half.
The question: How can I make the expression work so that when I select another currency but don't select monthyear, I still keep the RY but see the selected currency?
--> if I make a selection on MonthYear, it needs to show the selection. Not RY
Problem solved!
New code:
if(GetSelectedCount(MonthYear) = 0,
if(vCurrency = 'EUR',
num(
sum({< RY = {'1'}>}[#LinetotAfterDiscount]),
only( {< CurrencyCode = {'EUR'} >} CurrencyFormat0Decimals)),
num(
(sum( {< CURRID = {$(vCurrency)},RY = {'1'}>} [#LclLinetotAfterDiscount]) + sum( {< CURRID -= {$(vCurrency)}, RY = {'1'}>} [#LinetotAfterDiscount] / $(vCurrency))),
only( {< CurrencyCode = {$(vCurrency)} >} CurrencyFormat0Decimals)
)
),
num(
(sum( {< CURRID = {$(vCurrency)} >} [#LclLinetotAfterDiscount]) + sum( {< CURRID -= {$(vCurrency)} >} [#LinetotAfterDiscount] / $(vCurrency))),
only( {< CurrencyCode = {$(vCurrency)} >} CurrencyFormat0Decimals)
)
)
Problem solved!
New code:
if(GetSelectedCount(MonthYear) = 0,
if(vCurrency = 'EUR',
num(
sum({< RY = {'1'}>}[#LinetotAfterDiscount]),
only( {< CurrencyCode = {'EUR'} >} CurrencyFormat0Decimals)),
num(
(sum( {< CURRID = {$(vCurrency)},RY = {'1'}>} [#LclLinetotAfterDiscount]) + sum( {< CURRID -= {$(vCurrency)}, RY = {'1'}>} [#LinetotAfterDiscount] / $(vCurrency))),
only( {< CurrencyCode = {$(vCurrency)} >} CurrencyFormat0Decimals)
)
),
num(
(sum( {< CURRID = {$(vCurrency)} >} [#LclLinetotAfterDiscount]) + sum( {< CURRID -= {$(vCurrency)} >} [#LinetotAfterDiscount] / $(vCurrency))),
only( {< CurrencyCode = {$(vCurrency)} >} CurrencyFormat0Decimals)
)
)