11 Replies Latest reply: Mar 17, 2016 3:57 AM by A v

Complex Nesteed IFs - garbage after expression

Hello,

I need to have this 3 satements to define the colour of my bares, but I'm getting the fllowing error "garbage after expression"

My code is the following:

IF(A = 0,(IF(FIELD=1, RGB(34, 156, 228),IF(FIELD=2, RGB(0, 0, 0), IF(FIELD=3, RGB(34, 156, 228),IF(FIELD=4, RGB(0, 0, 0),IF(FIELD=5, RGB(34, 156, 228),IF(FIELD=6, RGB(0, 0, 0)))))))))

//

=IF(A= 1,

only({<FIELD={1}>} RGB(120,120,120)),

IF(A=2,

only({<FIELD={2)>} RGB(120,120,120)),

IF(A= 3,

only({<FIELD={3} RGB(120,120,120))));

=IF(A2=4,

only({<FIELD={4}>} RGB(120,120,120)),

IF(A2=5,

only({<FIELD={"<=5"}>} RGB(120,120,120)),

IF(A2=6,

only({<FIELD={"<=6)"}>} RGB(120,120,120))

)));

Can anybody help me?

• Re: Complex Nesteed IFs - garbage after expression

Not sure if you are showing two expressions or they are two alternatives, but try this may be:

IF(A = 0,

IF(Match(FIELD, 1, 3, 5), RGB(34, 156, 228),

IF(Match(FIELD, 2, 4, 6), RGB(0, 0, 0))))

• Re: Complex Nesteed IFs - garbage after expression

Hi Sunny T

Yes I'm trying with 3 expressions. let me test your code

• Re: Complex Nesteed IFs - garbage after expression

Your code Sunny_T saves the 1ªpart of my problem... but when I need to have:

=IF(A= 1,

only({<FIELD={1}>} RGB(120,120,120)),

IF(A=2,

only({<FIELD={2)>} RGB(120,120,120)),

IF(A= 3,

only({<FIELD={3} RGB(120,120,120))));

=IF(A2=4,

only({<FIELD={4}>} RGB(120,120,120)),

IF(A2=5,

only({<FIELD={"<=5"}>} RGB(120,120,120)),

IF(A2=6,

only({<FIELD={"<=6)"}>} RGB(120,120,120))

)));

I will have the same problem

• Re: Complex Nesteed IFs - garbage after expression

I am not sure what exactly are you trying to do. Why are there two expressions here?

• Re: Complex Nesteed IFs - garbage after expression

Basically:

- I have two slicers to influence the colour of my chart;

- If the the slicer (A) = 0 then all the colours but be like you write in first answer.
- IF the slicer (A) = 1 then the first bar should have a specific colour
- IF the slicer (A) = 2 then the first and second bar should have a specific colour
- IF the slicer (A) = 3 then the first and second and third bar should have a specific colour

- IF the slicer (A2) = 4 then the fourth bar should have a specific colour

- IF the slicer (A2) = 5 then the fourth  and fifth and second bar should have a specific colour
- IF the slicer (A2) = 6 then the fourth  and fifth and sixth and second and third bar should have a specific colour

• Re: Complex Nesteed IFs - garbage after expression

Won't these slider interfere in defining e.g. color for second bar?

• Re: Complex Nesteed IFs - garbage after expression

I've One dimension with 6 labels:

Slicer A: Influences colour of Label 1,2,3
Slicer A2: Influences colour of Label 4,5,6

• Re: Complex Nesteed IFs - garbage after expression

can you post a sample application to test with?

• Re: Complex Nesteed IFs - garbage after expression

Here you have

• Re: Complex Nesteed IFs - garbage after expression

What are you expecting to do?

• Re: Complex Nesteed IFs - garbage after expression

First Silcer (0,1,2,3):
- Value 0 selected - All the colours have the colour default:

IF(A = 0,

IF(Match(FIELD, 1, 3, 5), RGB(34, 156, 228),

IF(Match(FIELD, 2, 4, 6), RGB(0, 0, 0))))

- Value 1 selected:
Only bares from local 1 change to a new colour (green for example).

- Value 2 selected:

Only bares from local 1 and 2 change to a new colour (green for example).

- Value 3 selected:

Only bares from local 1 and 2  and 3 change to a new colour (green for example).

Second Slicer (4,5,6):

- Value 4 selected:
Only bares from local 4 change to a new colour (green for example).

- Value 5 selected:

Only bares from local 4 and 5 change to a new colour (green for example).

- Value 6 selected:

Only bares from local 4 and 5  and 6 change to a new colour (green for example).

I need to create two slicers because customers wants a slicer with 2 points, so I create this tricky solution to provide it two selectores in slicers.

Thanks!