SlicingDice Documentation

SlicingDice API Docs

Welcome to the SlicingDice API documentation. You'll find comprehensive guides and documentation to help you start working with SlicingDice as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides

Differences on Attribute and Event Columns

First time checking our docs? You might want to start with the right foot by reading our Documentation Guide first.


On this page we will explain the main differences between attribute and event columns, to summarize the difference is very simple: event columns are time-based and attribute columns are not.

Conceptual Differences

Before explaining further the difference between attribute and event columns, as data and code is worth more than 1,000 words, please take a look on this data table below:

User ID
Name
Age
Clicks

UUID-01

Jeff

25

Add to Cart - {% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}
Pay Now - {% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}
Support - {% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}

UUID-02

Michelle

32

Pay Now - {% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}

UUID-03

Lerry

47

Support - {% convert_date 'YYYY-MM-DDT00:41:34Z' '-1d' %}
Pay Now - {% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}

INSERT INTO users ([entity-id], [clicks.0.value], [clicks.0.date], [clicks.1.value], [clicks.1.date], [clicks.2.value], [clicks.2.date], name, age) VALUES ("UUID-01", "Add to Cart", "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}", "Pay Now", "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}", "Support", "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}", "Jeff", 25);
INSERT INTO users ([entity-id], [clicks.0.value], [clicks.0.date], name, age) VALUES ("UUID-02", "Pay Now", "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}", "Michelle", 32);
INSERT INTO users ([entity-id], [clicks.0.value], [clicks.0.date], [clicks.1.value], [clicks.1.date], name, age) VALUES ("UUID-03", "Support", "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}", "Pay Now", "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}", "Lerry", 47);
$ curl -X POST https://api.slicingdice.com/v1/sql \
    -H 'Authorization: MASTER_OR_WRITE_API_KEY' \
    -H 'Content-Type: application/sql' \
    -d 'INSERT INTO users ([entity-id], [clicks.0.value], [clicks.0.date], [clicks.1.value], [clicks.1.date], [clicks.2.value], [clicks.2.date], name, age) VALUES ("UUID-01", "Add to Cart", "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}", "Pay Now", "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}", "Support", "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}", "Jeff", 25); INSERT INTO users ([entity-id], [clicks.0.value], [clicks.0.date], name, age) VALUES ("UUID-02", "Pay Now", "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}", "Michelle", 32); INSERT INTO users ([entity-id], [clicks.0.value], [clicks.0.date], [clicks.1.value], [clicks.1.date], name, age) VALUES ("UUID-03", "Support", "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}", "Pay Now", "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}", "Lerry", 47);'
curl -X POST https://api.slicingdice.com/v1/insert \
    -H 'Authorization: MASTER_OR_WRITE_API_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
        "UUID-01": {
            "dimension": "users",
            "name": "Jeff",
            "age": 25,
            "clicks": [
                {
                    "value": "Add to Cart",
                    "date": "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}"
                }, {
                    "value": "Pay Now",
                    "date": "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}"
                }, {
                    "value": "Support",
                    "date": "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}"
                }
            ],
        },
        "UUID-02": {
            "dimension": "users",
            "name": "Michelle",
            "age": 32,
            "clicks": [
                {
                    "value": "Pay Now",
                    "date": "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}"
                }
            ]
        },
        "UUID-03": {
            "dimension": "users",
            "name": "Lerry",
            "age": 47,
            "clicks": [
                {
                    "value": "Support",
                    "date": "{% convert_date 'YYYY-MM-DDT00:41:34Z' '-1d' %}"
                }, {
                    "value": "Pay Now",
                    "date": "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}"
                }
            ]
        },
        "auto-create": ["dimension", "column"]
    }'
from pyslicer import SlicingDice
slicingdice = SlicingDice(master_key='MASTER_API_KEY', uses_test_endpoint=True)

insert_data = {
    "UUID-01": {
        "dimension": "users",
        "age": 25,
        "name": "Jeff",
        "clicks": [
            {
                "date": "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}",
                "value": "Add to Cart"
            }, 
            {
                "date": "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}",
                "value": "Pay Now"
            }, 
            {
                "date": "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}",
                "value": "Support"
            }
        ]
    },
    "UUID-03": {
        "dimension": "users",
        "age": 47,
        "name": "Lerry",
        "clicks": [
            {
                "date": "{% convert_date 'YYYY-MM-DDT00:41:34Z' '-1d' %}",
                "value": "Support"
            }, 
            {
                "date": "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}",
                "value": "Pay Now"
            }
        ]
    },
    "UUID-02": {
        "dimension": "users",
        "age": 32,
        "name": "Michelle",
        "clicks": [
            {
                "date": "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}",
                "value": "Pay Now"
            }
        ]
    },
    "auto-create": [
        "dimension", 
        "column"
    ]
}

print(slicingdice.insert(insert_data))

import com.slicingdice.jslicer.SlicingDice;
import java.io.IOException;
import org.json.JSONObject;
import org.json.JSONArray;

public class Example {
    public static void main(String[] args) throws IOException {
        SlicingDice slicingdice = new SlicingDice("MASTER_API_KEY", true);

        JSONObject insertData = new JSONObject()
        .put("UUID-01", new JSONObject()
            .put("dimension", "users")
            .put("age", 25)
            .put("name", "Jeff")
            .put("clicks", new JSONArray()
                .put(new JSONObject()
                    .put("date", "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}")
                    .put("value", "Add to Cart"))
                .put(new JSONObject()
                    .put("date", "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}")
                    .put("value", "Pay Now"))
                .put(new JSONObject()
                    .put("date", "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}")
                    .put("value", "Support"))))
        .put("UUID-03", new JSONObject()
            .put("dimension", "users")
            .put("age", 47)
            .put("name", "Lerry")
            .put("clicks", new JSONArray()
                .put(new JSONObject()
                    .put("date", "{% convert_date 'YYYY-MM-DDT00:41:34Z' '-1d' %}")
                    .put("value", "Support"))
                .put(new JSONObject()
                    .put("date", "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}")
                    .put("value", "Pay Now"))))
        .put("UUID-02", new JSONObject()
            .put("dimension", "users")
            .put("age", 32)
            .put("name", "Michelle")
            .put("clicks", new JSONArray()
                .put(new JSONObject()
                    .put("date", "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}")
                    .put("value", "Pay Now"))))
        .put("auto-create", new JSONArray()
            .put("dimension")
            .put("column"));

        JSONObject result = slicingdice.insert(insertData);
        System.out.println(result.toString());
    }
}
require 'rbslicer'
slicingdice = SlicingDice.new(master_key: 'MASTER_API_KEY', uses_test_endpoint: true)

insert_data = {
    "UUID-01" => {
        "dimension" => "users",
        "age" => 25,
        "name" => "Jeff",
        "clicks" => [
            {
                "date" => "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}",
                "value" => "Add to Cart"
            }, 
            {
                "date" => "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}",
                "value" => "Pay Now"
            }, 
            {
                "date" => "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}",
                "value" => "Support"
            }
        ]
    },
    "UUID-03" => {
        "dimension" => "users",
        "age" => 47,
        "name" => "Lerry",
        "clicks" => [
            {
                "date" => "{% convert_date 'YYYY-MM-DDT00:41:34Z' '-1d' %}",
                "value" => "Support"
            }, 
            {
                "date" => "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}",
                "value" => "Pay Now"
            }
        ]
    },
    "UUID-02" => {
        "dimension" => "users",
        "age" => 32,
        "name" => "Michelle",
        "clicks" => [
            {
                "date" => "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}",
                "value" => "Pay Now"
            }
        ]
    },
    "auto-create" => [
        "dimension", 
        "column"
    ]
}

puts slicingdice.insert(insert_data)

const SlicingDice = require('slicerjs');

const usesTestEndpoint = true;
const slicingdice = new SlicingDice({masterKey: 'MASTER_API_KEY'}, usesTestEndpoint);

const insertData = {
    "UUID-01": {
        "dimension": "users",
        "age": 25,
        "name": "Jeff",
        "clicks": [
            {
                "date": "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}",
                "value": "Add to Cart"
            }, 
            {
                "date": "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}",
                "value": "Pay Now"
            }, 
            {
                "date": "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}",
                "value": "Support"
            }
        ]
    },
    "UUID-03": {
        "dimension": "users",
        "age": 47,
        "name": "Lerry",
        "clicks": [
            {
                "date": "{% convert_date 'YYYY-MM-DDT00:41:34Z' '-1d' %}",
                "value": "Support"
            }, 
            {
                "date": "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}",
                "value": "Pay Now"
            }
        ]
    },
    "UUID-02": {
        "dimension": "users",
        "age": 32,
        "name": "Michelle",
        "clicks": [
            {
                "date": "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}",
                "value": "Pay Now"
            }
        ]
    },
    "auto-create": [
        "dimension", 
        "column"
    ]
};

slicingdice.insert(insertData).then((resp) => {
    console.log(resp);
}, (err) => {
    console.error(err);
});

<?php
use Slicer\SlicingDice;
$usesTestEndpoint = true;
$slicingdice = new SlicingDice(array("masterKey" => "MASTER_API_KEY"), $usesTestEndpoint);

$insertData = array(
    "UUID-01" => array(
        "dimension" => "users",
        "age" => 25,
        "name" => "Jeff",
        "clicks" => array(
            array(
                "date" => "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}",
                "value" => "Add to Cart"
            ), 
            array(
                "date" => "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}",
                "value" => "Pay Now"
            ), 
            array(
                "date" => "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}",
                "value" => "Support"
            )
        )
    ),
    "UUID-03" => array(
        "dimension" => "users",
        "age" => 47,
        "name" => "Lerry",
        "clicks" => array(
            array(
                "date" => "{% convert_date 'YYYY-MM-DDT00:41:34Z' '-1d' %}",
                "value" => "Support"
            ), 
            array(
                "date" => "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}",
                "value" => "Pay Now"
            )
        )
    ),
    "UUID-02" => array(
        "dimension" => "users",
        "age" => 32,
        "name" => "Michelle",
        "clicks" => array(
            array(
                "date" => "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}",
                "value" => "Pay Now"
            )
        )
    ),
    "auto-create" => array(
        "dimension", 
        "column"
    )
);

print_r($slicingdice->insert($insertData));
?>
using System.Collections.Generic;
using Slicer;
using Newtonsoft.Json;

namespace SlicerTester.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            var slicingdice = new SlicingDice(masterKey: "MASTER_API_KEY", usesTestEndpoint: true);

            var insertData = new Dictionary<string, dynamic>{
                {"UUID-01", new Dictionary<string, dynamic>{
                    {"dimension", "users"},
                    {"age", 25},
                    {"name", "Jeff"},
                    {"clicks", new List<dynamic>{
                        new Dictionary<string, dynamic>{
                            {"date", "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}"},
                            {"value", "Add to Cart"}
                        }, 
                        new Dictionary<string, dynamic>{
                            {"date", "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}"},
                            {"value", "Pay Now"}
                        }, 
                        new Dictionary<string, dynamic>{
                            {"date", "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}"},
                            {"value", "Support"}
                        }
                    }}
                }},
                {"UUID-03", new Dictionary<string, dynamic>{
                    {"dimension", "users"},
                    {"age", 47},
                    {"name", "Lerry"},
                    {"clicks", new List<dynamic>{
                        new Dictionary<string, dynamic>{
                            {"date", "{% convert_date 'YYYY-MM-DDT00:41:34Z' '-1d' %}"},
                            {"value", "Support"}
                        }, 
                        new Dictionary<string, dynamic>{
                            {"date", "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}"},
                            {"value", "Pay Now"}
                        }
                    }}
                }},
                {"UUID-02", new Dictionary<string, dynamic>{
                    {"dimension", "users"},
                    {"age", 32},
                    {"name", "Michelle"},
                    {"clicks", new List<dynamic>{
                        new Dictionary<string, dynamic>{
                            {"date", "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}"},
                            {"value", "Pay Now"}
                        }
                    }}
                }},
                {"auto-create", new List<dynamic>{
                    "dimension", 
                    "column"
                }}
            };

            var result = slicingdice.Insert(insertData);
            System.Console.WriteLine(JsonConvert.SerializeObject(result).ToString());
        }
    }
}
package main
import (
    "fmt"
    "github.com/SlicingDice/slicingdice-go/slicingdice"
)
func main() {
    keys := new(slicingdice.APIKey)
    keys.MasterKey = "MASTER_API_KEY"
    slicingdice := slicingdice.New(keys, 60)
    slicingdice.Test = true

    insertData := map[string]interface{}{
        "UUID-01": map[string]interface{}{
            "dimension": "users",
            "age": 25,
            "name": "Jeff",
            "clicks": []interface{}{
                map[string]interface{}{
                    "date": "{% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %}",
                    "value": "Add to Cart",
                },
                map[string]interface{}{
                    "date": "{% convert_date 'YYYY-MM-DDT10:22:10Z' '-5d' %}",
                    "value": "Pay Now",
                },
                map[string]interface{}{
                    "date": "{% convert_date 'YYYY-MM-DDT17:05:25Z' '-2d' %}",
                    "value": "Support",
                },
            },
        },
        "UUID-03": map[string]interface{}{
            "dimension": "users",
            "age": 47,
            "name": "Lerry",
            "clicks": []interface{}{
                map[string]interface{}{
                    "date": "{% convert_date 'YYYY-MM-DDT00:41:34Z' '-1d' %}",
                    "value": "Support",
                },
                map[string]interface{}{
                    "date": "{% convert_date 'YYYY-MM-DDT09:41:17Z' '-3d' %}",
                    "value": "Pay Now",
                },
            },
        },
        "UUID-02": map[string]interface{}{
            "dimension": "users",
            "age": 32,
            "name": "Michelle",
            "clicks": []interface{}{
                map[string]interface{}{
                    "date": "{% convert_date 'YYYY-MM-DDT16:21:16Z' '-4d' %}",
                    "value": "Pay Now",
                },
            },
        },
        "auto-create": []interface{}{
            "dimension",
            "column",
        },
    }

    fmt.Println(slicingdice.Insert(insertData))
}

Suppose you have the data above. As you can see, the Clicks column is storing event data, and the other columns are storing attributes, like Name and Age.

That's basically the difference between Attribute Columns and Event Columns:

  • Attribute Column is the column type used to store any data not associated to a date/time. Example: storing the value Jeff for the Name column and the value 25 for the Age column. In this case both columns and its values are not associated to a specific date/time.

  • Event Column is the column type used to store data that is associated to a date/time. Example: storing the value Add to Cart on the date/time {% convert_date 'YYYY-MM-DDT12:54:12Z' '-10d' %} for the Click event column. In this case it's important to know when the Add to Cart event happened.


Technical Difference

The technical differences between attribute columns and event columns is that the later allows you to perform time-based and frequency-based queries, by using the between and minfreq query parameters . Event columns are also used for the date histogram aggregations Aggregations .


Commercial Difference

Considering the pay-per-column pricing model, there is a price difference between attribute and event columns.

You can check the price directly on SlicingDice website

Unlimited and Free Data Storage

Remember: by using the pay-per-column pricing model, the amount of data (values/rows) you insert for each column (attributes or events) will NOT impact on your monthly costs.


Differences on Attribute and Event Columns

First time checking our docs? You might want to start with the right foot by reading our Documentation Guide first.