Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've used a pick(match) statement as i wanted to avoid nested ifs, however following previous posts I cant seem to get mine to work.
vSalesExpressions- is set by an input box to one of the strings defined, I have put this expression as an expression in a line graph.
pick(Match($(vSalesExpressions),'Avg Sales','Median
Sales','Avg Winning Products','Avg Loosing Products','Top 10 Sales','Bottom 10 Sales'),
Avg(ProfitPc),
Median(ProfitPc),
Avg({1<profitindicator = {1} >}ProfitPc),
Avg({1<profitindicator = {0} >}ProfitPc),
Avg({1<SalesPerson = {"=Rank(aggr(avg(ProfitPc),
SalesPerson)) <= 10"}>}ProfitPc),
Avg({1<SalesId = {"=Rank(aggr(-avg(ProfitPc),SalesId))<=10 "}>} ProfitPc)
)
Thanks!!
I think that the first parameter of the match() function must be string, not an expression.
Regards,
Michael
I would try enclosing your variable expansion into single quotes:
pick(Match( '$(vSalesExpressions)' ,'Avg Sales','Median...
Thanks for your suggestion, however it hasnt seemed to have worked.
just to clarify vSalesExpression stores a string.
Thanks for your suggestion, however it hasnt seemed to have worked.
just to clarify vSalesExpression stores a string.
Seems to work for me (using single quotes around the variable expansion). See attached.
Have you checked that your strings are not differing in trailing / leading spaces or in case?
Thanks for your suggestion, however it hasnt seemed to have worked.
just to clarify vSalesExpression stores a string.
Thankyou guys for all your help,
in replicating my conditions for you swuehl i found that it was nt working becuase I had a space in my strings!!!
when removing space in the string comparisons it worked. so 'avg sales' is now 'avgsales'
I'm not sure why the space posed this issue!
This then leads me to have to think of a way to make the selection box user friendly as having words with no spaces doesnt look very noce.
Sorry back to the drawing bord for me, I have it working but the spaces in the stings was not the issue. Still trying to find out what the issue is>