Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I will try to explain what I am trying to do with a sample attached.
I'm trying to evaluate rank based on either product category or the rank of the Product
Example in the Snapshot I've selected Product D1 and the rank for the same is "6"
but I've achieved that using a variable to identify the AGGR level
my expression
Expression: aggr(rank(sum({1}Amount)),$(vAggrLevel))
vAggrLevel =if(GetSelectedCount(Level2)>0,'Level2','Level1')
Can we do this without using the variable? directly in the expression??
Thanks
Vineeth
I doubt that $Field could be useful here because you will furthermore need any checkings if there is any selection anywhere. The if-loop itself might be replaceable with a pick(match()) and also there might be ways to create such a expression-statement with a kind of string-loop. But I think it won't make your task easier - rather the opposite will happens.
Why not just copying the if-checking within a variable ten times beneath eachother ... ok. it won't look very nice but there won't be a real performance-impact on this textbox-expression.
- Marcus
Yes, busy with lot of work.
Hi Vineeth,
Try this:
=aggr(rank(sum({1}Amount)),$(='[' &MaxString(
Aggr(
If(Upper(Left(Trim(SubField(SubField(GetCurrentSelections(),chr(13)),':',1)),5)) = 'LEVEL',
Trim(SubField(SubField(GetCurrentSelections(),chr(13)),':',1))
,1)
,$Field)
)&']'))
Regards!!
Thanks Manuel, this is exactly what I was trying to do but couldn't
Cheers
Vineeth
You're wellcome!!
Cheers!