Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load statement

Please can someone help.

I am trying to cxreate another column in the load statement that will do a calculation of field.

Currently we have "solution_Time_Achieved" which shows 'Yes', 'No' and 'NA'.

The calculation used on my documen to get the percentage are as follows:

=Num(Count ({$<SOLUTION_TIME_ACHIEVED={'Yes'}>} SOLUTION_TIME_ACHIEVED) / Count({$<SOLUTION_TIME_ACHIEVED={'Yes','No'}>} SOLUTION_TIME_ACHIEVED),'##%')

However this makes it difficult to change colors depending on certain values on a bar chart so I want to create another column in the LOAD statement that will already work out the percentage. That way I can say if value is higher or lower it should show this or that color.

I tried the following but it does not work:

PICData:
LOAD *,
(
SOLUTION_TIME_ACHIEVED) like 'Yes' / (SOLUTION_TIME_ACHIEVED) like 'Yes','No' AS SOLUTION_TIME_PERCENTAGE

FROM
[\\smuc6314\L4_AGILO8_SHARE\QV_Projects\QVZA\ITSM-Reporting_P\11_QVD_Generator_QVD\FG-ZA_AllData.qvd]
(
qvd);

1 Solution

Accepted Solutions
Not applicable
Author

Dont worry I got it right!!

I used the following on the expression "Background color"

=if(Count ({<SOLUTION_TIME_ACHIEVED={'Yes'}>} SOLUTION_TIME_ACHIEVED) / Count({<SOLUTION_TIME_ACHIEVED={'Yes','No'}>} SOLUTION_TIME_ACHIEVED) >=0.95, RGB(0,128,0), RGB(255,0,0))

View solution in original post

4 Replies
Not applicable
Author

I thought about it last night and this was a stupid question, sorry. This will never work as it is a calculation of a couple of fields so there is no way of adding it as a column. So now my question:

How can I change the colors on the bar chart to show:

red - if value of expression is below 95%

Green - if value of expression is above 95%

My bar chart uses the following expression:

=Count ({<SOLUTION_TIME_ACHIEVED={'Yes'}>} SOLUTION_TIME_ACHIEVED) / Count({<SOLUTION_TIME_ACHIEVED={'Yes','No'}>} SOLUTION_TIME_ACHIEVED

and I display it as percentage.

Not applicable
Author

Capture.JPG

Not applicable
Author

Dont worry I got it right!!

I used the following on the expression "Background color"

=if(Count ({<SOLUTION_TIME_ACHIEVED={'Yes'}>} SOLUTION_TIME_ACHIEVED) / Count({<SOLUTION_TIME_ACHIEVED={'Yes','No'}>} SOLUTION_TIME_ACHIEVED) >=0.95, RGB(0,128,0), RGB(255,0,0))

Not applicable
Author

Good Job. Mark your answer as correct answer and close the thread please