Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a Dimension Product Category(Apple, Orange).
Then I create a new variable like below;
set VSelect_Product= =Only(Select_Product);
Select_Product:
Load * Inline [
Select_Product
Apple
Orange
]
;
I want to user click the Select_Product filter box to show Apple or Orange or Apple and Orange in the same time
For Apple expression.
if ( WildMatch(concat(distinct Select_Product,', ') ,'*Apple*'),
Sum({$< [Product Category] ={'Apple'}
,Month ={">=$(=AddMonths(max([Month]),-$(vperiod)))<=$(=max([Month]) )"}
>} OPI)
)
For Orange expression.
if ( WildMatch(concat(distinct Select_Product,', ') ,'*Orange*'),
Sum({$< [Product Category] ={'Orange'}
,Month ={">=$(=AddMonths(max([Month]),-$(vperiod)))<=$(=max([Month]) )"}
>} OPI)
)
Both expression work fine if i dont select Month. However, if i select Month it only show the selected Month.
But if i revise the expression :
Sum({$< [Product Category] ={'Orange'}
,Month ={">=$(=AddMonths(max([Month]),-$(vperiod)))<=$(=max([Month]) )"}
>} OPI)
It can also show different month.
How can I revise the expression to match my purpose.
I don't know if this will solved your issue, however, you should be able to remove the IF changing your expression like this:
Apple expression.
Sum({$< [Product Category] *={'Apple'}
,Month ={">=$(=AddMonths(max([Month]),-$(vperiod)))<=$(=max([Month]) )"}
>} OPI)
Orange expression.
Sum({$< [Product Category] *={'Orange'}
,Month ={">=$(=AddMonths(max([Month]),-$(vperiod)))<=$(=max([Month]) )"}
>} OPI)
I don't know if this will solved your issue, however, you should be able to remove the IF changing your expression like this:
Apple expression.
Sum({$< [Product Category] *={'Apple'}
,Month ={">=$(=AddMonths(max([Month]),-$(vperiod)))<=$(=max([Month]) )"}
>} OPI)
Orange expression.
Sum({$< [Product Category] *={'Orange'}
,Month ={">=$(=AddMonths(max([Month]),-$(vperiod)))<=$(=max([Month]) )"}
>} OPI)
Thanks for your help