2 Replies Latest reply: Jun 11, 2012 4:12 AM by Nagaraj Rangaiah

# Expression background

Hi Team,

I am using attached big formula in the expression background, because of which QV is working slowly, So i need to minimize the formul or put in varialbe or at script or at macro.

Please give ur suggestion and help, Thanks

Regards,

Nagaraj

• ###### Re: Expression background

Hi Nagaraj,

I have two solution on this case. But not sure it can make your app more better performace.

Solution1: via expression

```IF(MATCH(Only({1}[AT]),'Emad','Investor Education','Telephone - VB'),RGB(0,128,128),
IF(MATCH(Only({1}[AT]),'CB','Dea','Pilot’),RGB(102,194,150),
IF(MATCH(Only({1}[AT]),'5'),RGB(141,170,203),
IF(MATCH(Only({1}[AT]),'6'),RGB(151,203,255),
IF(MATCH(Only({1}[AT]),'B','Ent','Meeting - Marketing'),RGB(178,178,178),
IF(MATCH(Only({1}[AT]),'4','C','Cor','Event','Meeting - Review','Telephone - VM'),RGB(178,36,36),
IF(MATCH(Only({1}[AT]),'Em','Telephone - Conference'),RGB(179,0,0),
IF(MATCH(Only({1}[AT]),'Ema','Holiday/Sickness/Other','Telephone - Inbound'),RGB(200,200,200),
IF(MATCH(Only({1}[AT]),'2'),RGB(207,207,207),
IF(MATCH(Only({1}[AT]),'Emae'),RGB(255,178,128),
IF(MATCH(Only({1}[AT]),'CA','De','Event - Conference','Meeting - Visit','Training'),RGB(255,188,64),
IF(MATCH(Only({1}[AT]),'Cl','El','Event - Expert','Review'),RGB(255,217,47)
))))))))))))))
```

Solition2: Load a table with three field (No, Values, ColoreCode) and then link Values field to other that need to set color.

```[DataColore]:
No    ,    Values    ,    ColorCode
1    ,    1    ,    RGB(231,138,210)
2    ,    2    ,    RGB(207,207,207)
3    ,    3    ,    RGB(255,0,0)
4    ,    4    ,    RGB(178,36,36)
5    ,    5    ,    RGB(141,170,203)
6    ,    6    ,    RGB(151,203,255)
7    ,     A    ,    RGB(255,0,0)
8    ,     B    ,    RGB(178,178,178)
9    ,     C    ,    RGB(178,36,36)
10    ,     CA    ,    RGB(255,188,64)
11    ,     CB    ,    RGB(102,194,150)
12    ,     Cl    ,    RGB(255,217,47)
13    ,     Co    ,    RGB(231,138,210)
14    ,     Con    ,    RGB(179,179,179)
15    ,     Cor    ,    RGB(178,36,36)
16    ,     De    ,    RGB(255,188,64)
17    ,     Dea    ,    RGB(102,194,150)
18    ,     El    ,    RGB(255,217,47)
19    ,     Em    ,    RGB(179,0,0)
20    ,     Em    ,    RGB(231,138,210)
21    ,     Ema    ,    RGB(200,200,200)
23    ,     Emae    ,    RGB(255,178,128)
24    ,     Ent    ,    RGB(178,178,178)
25    ,     Event    ,    RGB(178,36,36)
26    ,     Event - Conference    ,    RGB(255,188,64)
27    ,     Event - Expert    ,    RGB(255,217,47)
28    ,     Event – Reverse Roadshow    ,    RGB(231,138,210)
29    ,     Event - Roadshow    ,    RGB(179,179,179)
30    ,     Holiday/Sickness/Other    ,    RGB(200,200,200)
31    ,     Investor Education    ,    RGB(0,128,128)
32    ,     Meeting    ,    RGB(255,0,0)
33    ,     Meeting - Marketing    ,    RGB(178,178,178)
34    ,     Meeting - Review    ,    RGB(178,36,36)
35    ,     Meeting - Visit    ,    RGB(255,188,64)
36    ,     Pilot’    ,    RGB(102,194,150)
37    ,     Review    ,    RGB(255,217,47)
38    ,     Telephone - Conference    ,    RGB(179,0,0)
39    ,     Telephone - Inbound    ,    RGB(200,200,200)
40    ,     Telephone - VB    ,    RGB(0,128,128)
41    ,     Telephone - VM    ,    RGB(178,36,36)
42    ,     Telephone Call    ,    RGB(231,138,210)
43    ,     Training    ,    RGB(255,188,64)];
```

After that use <ColorCode> in colore expression.

By the way, I suggest you to use solution 2. Because it easy to monitor colore code as well as no complicate IF statement.

Do let me know once you have test it.

Regards,

Sokkorn

• ###### Re: Expression background

Hi Sokkorn,

Thanks for U R help, both the solution did not work for me,

S1: No difference in performance

S2: Brings black color on the chart, if some non associative data is selected, that the reason we have used, Only({1

I have attached data and a sample QV, here background color work fine when we drill down in AT chart, but when we click on the BV chart background of AT chart turns black because of the null values.. so we ave used Only({1

This works fine but there is performance issue with this.

Once again thank you for your effort,

Regards,

Nagaraj