Klipfolio. The KPI Dashboard - Evolved
The KPI Dashboard – Evolved
1-877-233-6149
Contact Us

Why is my Klip displaying fewer items than the data source?

Problem:

Your Klip shows fewer items than the number of items in the data source.

Solution:


If your Klip is displaying more items than the number of items in the data source, see the troubleshooting tip, "Why does my Klip still display items that have been removed from the source?"

Use key: override for the column that uniquely identifies each item.

How it works

When items are coming in from the content source location, Klipfolio Dashboard compares them with the existing items in the Klip. If an incoming item is identical to one of the existing items in the Klip, the new one will replace the existing one.

However, you may want to display all items from the source even if some of them are identical. For example, in the case of a typical purchase order list, it's possible for a customer to have ordered the same number of same items twice. If there are 100 purchase orders in the entire list, you will want to display all 100 purchase order items in your Klip, not 99 just because two orders are identical .

In most data sources, be it a purchase order or an RSS feed, there is usually one tag or column that uniquely identifies each item, such as an Order ID, Employee ID, or, in the case of an RSS feed, <guid>.

By using the property key: override for that column, you can tell the Klip to use only that unique ID for comparison of each item and ignore the rest.

key: override

Let's say the Order ID uniquely identifies each item in your data source. The following code will tell the Klip to use only its values when comparing incoming data with existing ones:

Order_ID {
    itemcol: 1;
    key: override;        
}

Tip: If you want to use the Order ID for this purpose but don't want to actually display it in the Klip, you can remove the itemcol property.

Note that you can use key: override for only one column because it means "Use this column's content for item comparison and ignore the key settings of the other tags."

But what if you don't have any uniquely identifying information for each item in your source?

key: exclude

If your data source doesn't include a uniquely identifying column, you can use key: exclude to tell the application not to use the content of that column(s) when comparing items. Consider the content of each column and ask yourself, "Which columns should be included in the comparison at a minimum so that the combination of those columns will make each item uniquely different from one another?" Any columns that do not need to be included can be set with key: exclude.

Try it

Try loading the example Klip. Its content source has 4 items that look like this:

Order ID,Style,Description,Type,Color,Fabric
1023,Island,Happy,T-shirt,red,100% Cotton
1024,Island,Happy,T-shirt,blue,100% Cotton
1025,Island,Happy,T-shirt,blue,100% Cotton
1026,Island,Happy,T-shirt,yellow,Cotton blend

However, when you load the example Klip, you will see only one item:
http://www.klipfolio.com/static/klips/samples/key/key1.png

This is because the Klip has three columns, for Style, Description and Type, and none uses the key property. Therefore, as far as the Klip is concerned, this is all it sees:

Island,Happy,T-shirt
Island,Happy,T-shirt
Island,Happy,T-shirt
Island,Happy,T-shirt

As you can see, all 4 items are identical, so each incoming item replaces the previous one. As a result, only one item is displayed.Now, add the following to the Klip's <style> block, save and reload it. This will introduce more columns to the Klip that need to be included in the item comparison:

Color {
    itemcol: 4;
}
Fabric {
    itemcol: 5;
}

Even then, you will see only 3 items:
http://www.klipfolio.com/static/klips/samples/key/key2.png

This is because the following is what the Klip sees now. Note how there are two blue T-shirt items that are exactly the same.

Island,Happy,T-shirt,red,100% Cotton
Island,Happy,T-shirt,blue,100% Cotton
Island,Happy,T-shirt,blue,100% Cotton
Island,Happy,T-shirt,yellow,Cotton blend
But if you include the Order ID in the Klip and use key: override, you will see that all 4 unique items are listed in the Klip. To do so, add this to the <style> block, save and reload it.

Order_ID {
    key: override;
}

Here's what the Klip should look like when it is reloaded:
http://www.klipfolio.com/static/klips/samples/key/key3.png

Leave a Comment

To leave a comment, you must sign in or register (it's free).

   
Comment Type:
Title:
Comment: