Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a table containing a list of dimensions called Segments. There are 65 segments called S0001, S0002, S0003 ... S0065.
I need to filter my sum by some of these segments. There are three main measures:
I am currently using simple and shorter measures with following expression:
=sum({<segment_id={'S0001', 'S0002', 'S0003','S0004'}>}line_amount)
This will become troublesome and very long when I add all the segments. Especially because at a later stage, other dimensions will be added (ex: Group, G0001 - G0100 etc).
How could I facilitate or automate this expression? I was exploring using a Right(segment_id,2) < 23 for instance, but it does not seem to work. I can't handle the syntax.
I am at this point not willing to create flags in the script due to constraints given by the client.
Thanks!
=sum({<segment_id={"=Num(Right(segment_id,2)) > 23 AND Num(Right(segment_id,2)) < 50"}>}line_amount)
May be like:
=sum({<segment_id={"=Num(Right(segment_id,2)) < 23"}>}line_amount)
Nice, this seems to work properly!
How would you apply the condition for the segment id to be between 23 & 50?
=sum({<segment_id={"=Num(Right(segment_id,2)) > 23 AND Num(Right(segment_id,2)) < 50"}>}line_amount)
Thank you