Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want my expression to show the sales amount of the latest month if no months are selected (Field: DW_SK_Date). However, if one or multiple months are selected the expression has to show the selected months.
I have a field (IsCurrent) that specifies if it is the latest month (ISCurrent=1) or not (ISCurrent=0).
I have tried to make a variable with the IF Statement and then put it into a set expression (see below), but it does not work.
Can someone please help me out?
Variable: vISCurrent = IF(GetSelectedCount(DW_SK_Date)=0,1,0)
Set Expression: Sum({<IsCurrent={$(vISCurrent)}>}Amount)
Please see my test dataset attached
Kind Regards,
Thomas
How about this?
Sum({<IsCurrent={$(=If(GetSelectedCount(DW_SK_Date)=0,1,0))}>}Amount)
Try this may be
Sum({<IsCurrent={$(=vISCurrent)}>}Amount)
Still does not work, unfortunately
How about this?
Sum({<IsCurrent={$(=If(GetSelectedCount(DW_SK_Date)=0,1,0))}>}Amount)
That seems to work. Thanks!
Do you know why it does not work with a variable? Or what I can do to put it into a variable, as I will have to make this calculation in several other expressions?
Does you variable include the = sign or not?
=If(GetSelectedCount(DW_SK_Date)=0,1,0)
Try adding or removing it and see if that makes any difference?
You're right.
It removes the equal sign in front of the variable if I am typing the expression in the expression editor (fx), however if I type it directly in the definition dialog box it keeps it - Weird
Anyway, thanks a lot for your help.