Quantcast
Channel: SharePoint 2010 TechTalk » sharepoint designer 2010
Viewing all articles
Browse latest Browse all 2

SharePoint 2010: Simple KPI Using Calculated Columns

$
0
0
In this post, I will show you how you can create a Status KPI based off STRING values instead of calculated values. This stemmed from a requirement to show Red, Green, or Yellow statuses based on what the user input. So if you have a task list with three statuses: Not Started, In Progress, Completed Or if you have a task list where each item has a check box that says “Complete?”, you can check it off and instead of having the standard “Yes” or “No” outputted on the list, you can have a KPI icon of the green dot or the red diamond representing the status of the task. Normally you would have to return a value based on each status in order to trigger the SharePoint KPIs. However, I’ll show you how you can create a KPI for it based off what the choice is for the current status is without having to return any numerical values. And we will do this using calculated columns. Create a standard custom list and create a column called “Completed?” and choose Yes/No (check box) as the column type. Click OK. Now for each Check Box column, you’re going to need a calculated column to display the KPI icon you want based off the Check Box column. So create a new column. I named this one Completed Icon and set it to “Calculated (calculation based on other columns)” This column will be calculated based off the value in the “Completed?” column. Basically we want this column to show    when the “Completed?” column is checked and  when the “Completed?” column is not checked. These two icons are built into the SharePoint library located in the  /_layouts/images/ folder with the green dot named KPIDefault-0.GIF and the red diamond named KPIDefault-2.GIF In order to make us do what we want, we need to insert this one-line statement into the calculated column: ="<DIV><img src='"&IF([Completed?], "/_layouts/images/KPIDefault- 0.GIF", "/_layouts/images/KPIDefault-2.GIF")&"'></DIV>" This basically checks the “Completed?” column to see if the check box is checked and it will return the first image (green dot) if it’s true and the second image (red diamond) if it’s false. The “<DIV>” tags will be required when we want to show HTML on our list.  

Viewing all articles
Browse latest Browse all 2

Trending Articles