cancel
Showing results for 
Search instead for 
Did you mean: 

How to link data to the blox

tsaho8
7 - Data Storage
7 - Data Storage

Hi Team,

Could you please help me to understand how can I link my column values in the blox code. As per the below code I want to display Revenue in the dashboard but getting 

 

{
    "style": "",
    "titleStyle": [
        {
            "display": "none"
        }
    ],
    "script": "[].slice.call( document.getElementsByClassName('blox-date') ).forEach(function ( div ) { div.innerHTML = new Date().toLocaleDateString(); })",
    "title": "",
    "showCarousel": true,
    "carouselAnimation": {
        "delay": 0,
        "showButtons": false
    },
    "conditions": [
        {
            "minRange": "-Infinity",
            "maxRange": 0,
            "color": "#FA5656",
            "image": "/plugins/BloX/blox-images/StockMarket/arrow-down.png"
        },
        {
            "minRange": 0,
            "maxRange": "Infinity",
            "color": "#54a254",
            "image": "/plugins/BloX/blox-images/StockMarket/arrow-up.png"
        }
    ],
    "body": [
        {
            "spacing": "",
            "type": "Container",
            "width": "100%",
            "style": {
                "margin": "0 auto"
            },
            "items": [
                {
                    "type": "TextBlock",
                    "text": "FINANCIAL KPI'S | RUNNING WEEKLY TREND",
                    "class": "blox-pivot-title",
                    "horizontalAlignment": "center",
                    "size": "medium",
                    "style": {
                        "padding": "2px",
                        "border-radius": "5px",
                        "background-color": "#006374",
                        "color": "#ffffff"
                    }
                },
                {
                    "type": "ColumnSet",
                    "class": "condition_container ",
                    "columns": [
                        {
                            "type": "Column",
                            "items": [
                                {
                                    "spacing": "small",
                                    "type": "TextBlock",
                                    "text": "REVENUE",
                                    "horizontalAlignment": "center",
                                    "weight": "bold",
                                    "size": "small",
                                    "style": {
                                        "color": "#000000"
                                    }
                                },
                                {
                                    "type": "ColumnSet",
                                    "class": "condition_container ",
                                    "columns": [
                                        {
                                            "type": "Column",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "{panel:REVENUE}",
                                                    "horizontalAlignment": "center",
                                                    "weight": "bold",
                                                    "size": "large",
                                                    "style": {
                                                        "color": "#a90a40"
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "type": "ColumnSet",
                                    "class": "condition_container",
                                    "columns": [
                                        {
                                            "type": "Column",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "<span class='blox-sparkline' type='line' line-color='#006374' width='200' height='30' line-width='2' fill-color='#B2D4DF' point-color:'#A90A40'>{spark:-21REVENUE},{spark:-14REVENUE},{spark:-7REVENUE}</span>",
                                                    "horizontalAlignment": "center",
                                                    "weight": "bold",
                                                    "size": "small",
                                                    "style": {
                                                        "color": "#117899"
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "type": "ColumnSet",
                                    "columns": [
                                        {
                                            "type": "Column",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "BUDGET:",
                                                    "style": {
                                                        "text-align": "left",
                                                        "font-size": "small",
                                                        "font-style": "",
                                                        "color": "#d5d5d5"
                                                    }
                                                },
                                                {
                                                    "type": "TextBlock",
                                                    "text": "FULL MONTH FORECAST:",
                                                    "style": {
                                                        "text-align": "left",
                                                        "font-size": "small",
                                                        "font-style": "",
                                                        "color": "#d5d5d5"
                                                    }
                                                }
                                            ]
                                        },
                                        {
                                            "type": "Column",
                                            "width": "30%",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "{panel:REV_BUDGET}",
                                                    "style": {
                                                        "text-align": "center",
                                                        "font-size": "small",
                                                        "font-weight": "regular",
                                                        "color": "#006274",
                                                        "font-style": ""
                                                    }
                                                },
                                                {
                                                    "type": "TextBlock",
                                                    "text": "{panel:REVENUE_FORECAST}",
                                                    "style": {
                                                        "text-align": "center",
                                                        "font-size": "small",
                                                        "font-weight": "regular",
                                                        "color": "#006274",
                                                        "font-style": ""
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "separator": true,
                            "type": "Column",
                            "items": [
                                {
                                    "spacing": "small",
                                    "type": "TextBlock",
                                    "text": "CONTRIBUTION MARGIN",
                                    "horizontalAlignment": "center",
                                    "weight": "bold",
                                    "size": "small",
                                    "style": {
                                        "color": "#000000"
                                    }
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "{panel:CONT. MARGIN $} ({panel: CM%})",
                                    "horizontalAlignment": "center",
                                    "weight": "bold",
                                    "size": "large",
                                    "style": {
                                        "color": "#a90a40"
                                    }
                                },
                                {
                                    "type": "ColumnSet",
                                    "class": "condition_container 2",
                                    "columns": [
                                        {
                                            "type": "Column",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "<span class='blox-sparkline' type='line' line-color='#006374' width='200' height='30' line-width='2' fill-color='#B2D4DF' point-color:'#117899'>{spark:-21CM$},{spark:-14CM$},{spark:-7CM$}</span>",
                                                    "horizontalAlignment": "center",
                                                    "weight": "bold",
                                                    "size": "small",
                                                    "style": {
                                                        "color": "#117899"
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "type": "ColumnSet",
                                    "columns": [
                                        {
                                            "type": "Column",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "{panel:CM_BUDGET} ({panel:CMPERC_BUDGET})",
                                                    "style": {
                                                        "text-align": "right",
                                                        "font-size": "small",
                                                        "font-weight": "regular",
                                                        "color": "#006274",
                                                        "font-style": ""
                                                    }
                                                },
                                                {
                                                    "type": "TextBlock",
                                                    "text": "{panel:CM_FORECAST} ({panel:CM%})",
                                                    "style": {
                                                        "text-align": "right",
                                                        "font-size": "small",
                                                        "font-weight": "regular",
                                                        "color": "#006274",
                                                        "font-style": ""
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        },
                        {
                            "separator": true,
                            "type": "Column",
                            "items": [
                                {
                                    "spacing": "small",
                                    "type": "TextBlock",
                                    "text": "PRODUCTIVITY",
                                    "horizontalAlignment": "center",
                                    "weight": "bold",
                                    "size": "small",
                                    "style": {
                                        "color": "#000000"
                                    }
                                },
                                {
                                    "type": "TextBlock",
                                    "text": "{panel:PRODUCTIVITY}",
                                    "horizontalAlignment": "center",
                                    "weight": "bold",
                                    "size": "large",
                                    "style": {
                                        "color": "#a90a40"
                                    }
                                },
                                {
                                    "type": "ColumnSet",
                                    "class": "condition_container 3",
                                    "columns": [
                                        {
                                            "type": "Column",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "<span class='blox-sparkline' type='line' line-color='#006374' width='200' height='30' line-width='2' fill-color='#B2D4DF' point-color:'#117899'>{spark:PROD_M1},{spark:PROD_M2}, {spark:PROD_M3}</span>",
                                                    "horizontalAlignment": "center",
                                                    "weight": "bold",
                                                    "size": "small",
                                                    "style": {
                                                        "color": "grey"
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "type": "ColumnSet",
                                    "columns": [
                                        {
                                            "type": "Column",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "BUDGET:",
                                                    "style": {
                                                        "text-align": "left",
                                                        "font-size": "small",
                                                        "font-style": "",
                                                        "color": "#FFFFFF"
                                                    }
                                                },
                                                {
                                                    "type": "TextBlock",
                                                    "text": "PREV. MONTH:",
                                                    "style": {
                                                        "text-align": "left",
                                                        "font-size": "small",
                                                        "font-style": "",
                                                        "color": "#d5d5d5"
                                                    }
                                                }
                                            ]
                                        },
                                        {
                                            "type": "Column",
                                            "items": [
                                                {
                                                    "type": "TextBlock",
                                                    "text": "{panel:PROD_BUDGET}",
                                                    "style": {
                                                        "text-align": "center",
                                                        "font-size": "small",
                                                        "font-weight": "regular",
                                                        "color": "#006274",
                                                        "font-style": ""
                                                    }
                                                },
                                                {
                                                    "type": "TextBlock",
                                                    "text": "{panel:PRODUCTIVITY -1M}",
                                                    "style": {
                                                        "text-align": "center",
                                                        "font-size": "small",
                                                        "font-weight": "regular",
                                                        "color": "#006274",
                                                        "font-style": ""
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "actions": []
}

tsaho8_0-1680008989183.png

 

 

12 REPLIES 12

HamzaJ
12 - Data Integration
12 - Data Integration

Hey @tsaho8 

It think it is related to the fields you added, however the field-panel is collapsed and not shown in the screenshot. Could you perhaps add this? {panel: fieldname} makes it so that that field is used in Blox. So for {panel:Revenue} to work there needs to be a field with the name Revenue

 

Hamza

tsaho8
7 - Data Storage
7 - Data Storage

Hi Hamzaj,

I have used the field name(ncc) in the blox code but still showing NA in the output.

tsaho8_0-1680073215947.png

 

HamzaJ
12 - Data Integration
12 - Data Integration

Hey @tsaho8 

When adding a field to the Item-block the blox while iterate through al the options with the arrows. There is a chance that NCC has a N\A value which is shown first. What happens when you press the arrows? Does it show different data?

You can set 

"showCarousel": true, to false in the Editor on the right. This will display everything and you can see the connection between the field and the editor
 
Hamza

tsaho8
7 - Data Storage
7 - Data Storage

Hi Hamzaj,

I used the false condition and now showing multiple values of ncc but i need sum(ncc) so that one single value will display.

tsaho8_0-1680081712704.png

 

HamzaJ
12 - Data Integration
12 - Data Integration

If you remove NCC from the items-panel and leave it in the values, you will get a sum of NCC in a single blox

tsaho8
7 - Data Storage
7 - Data Storage

Hi Hamzaj,

I have removed the NCC from item and getting single value but that value is incorrect with actual .

Its showing 5.% M but it shd be 7.2 M..is thr any reason for this?

tsaho8_0-1680179578525.png

 

tsaho8
7 - Data Storage
7 - Data Storage

Hi @Angelina_QBeeQ,

I am trying to display max date in the box panel. Getting blank value. kindly help on below sc.

tsaho8_0-1683872483105.png

 

Silutions
10 - ETL
10 - ETL

In the left hand panel (you need to open it in your screen shot above), add the Items and Values you want to display.   Name them as appropriate and then update your BloX JSON panel code as appropriate with the names.

You might try looking at the BloX tutorials if this is not clear:  https://docs.sisense.com/main/SisenseLinux/sisense-blox-tutorials.htm

Regards, Jim

tsaho8
7 - Data Storage
7 - Data Storage

Hi Silutions,

I have used the field name(ncc) in the blox code but still showing NA in the output.

tsaho8_1-1680073302870.png

 

Hi @tsaho8 ,

The Item data type is integer, so please change string datatype.

 

Thanks

Sijo

tsaho8
7 - Data Storage
7 - Data Storage

Hi @Sijo1995 @HamzaJ @Silutions ,

I have created simple home page and wanted to add jump to dashboard feature into it. Kindly help me to integrate this feature into below code. Help me with one and will do it rest 3.

tsaho8_1-1680180293701.png

 

{
"style": "",
"script": "",
"title": "",
"showCarousel": true,
"body": [
{
"type": "Container",
"spacing": "extraLarge",
"style": {
"backgroundImage": "linear-gradient(#F5A9AA, #E97EA3)",
"box-shadow": "0 1px 3px 1px rgba(58,67,86,0.1)",
"padding": "50px"
},
"items": [
{
"type": "TextBlock",
"horizontalAlignment": "center",
"size": "large",
"weight": "bold",
"text": "SERVICING 360"
},
{
"type": "TextBlock",
"horizontalAlignment": "center",
"size": "medium",
"spacing": "small",
"text": "Open BloX Editor to customize filters"
}
]
},
{
"type": "Container",
"spacing": "extraLarge",
"width": "200px",
"Alignment": "center",
"style": {
"backgroundImage": "linear-gradient(#F5A9AA, #E97EA3)",
"box-shadow": "0 1px 3px 1px rgba(58,67,86,0.1)",
"padding": "20px"
},
"items": [
{
"type": "TextBlock",
"horizontalAlignment": "center",
"size": "large",
"weight": "bold",
"text": "SERVICING 360"
}
]
}
],
"actions": [
{
"type": "Filters",
"title": "Contact Sense Overview",
"data": {
"filters": [
{
"filterName": "Stage",
"filterJaql": {
"explicit": true,
"members": [
"Prospect"
]
}
},
{
"filterName": "Days in Date",
"filterJaql": {
"last": {
"count": 7,
"offset": 0
}
}
}
]
}
},
{
"type": "Filters",
"title": "Calls by Number of Topics",
"data": {
"filters": [
{
"filterName": "Stage",
"filterJaql": {
"explicit": true,
"members": [
"Prospect"
]
}
},
{
"filterName": "Risk Level",
"filterJaql": {
"from": 4
}
}
]
}
},
{
"type": "Filters",
"title": "Top Topics",
"data": {
"filters": [
{
"filterName": "Stage",
"filterJaql": {
"explicit": true,
"members": [
"Prospect"
]
}
},
{
"filterName": "Days Open",
"filterJaql": {
"from": 90
}
}
]
}
},
{
"type": "Filters",
"title": "Pair Topics",
"data": {
"filters": [
{
"filterName": "Stage",
"filterJaql": {
"explicit": true,
"members": [
"Prospect"
]
}
},
{
"filterName": "Days Open",
"filterJaql": {
"from": 90
}
}
]
}
}
]
}

Hi @tsaho8 ,

 

 

Dashboard id have to be specified for that button to activate the jumpto action. Please refer the code which I've provided. 

 

{
    "style": "",
    "script": "",
    "title": "",
    "showCarousel": true,
    "body": [
        {
            "type": "Container",
            "spacing": "extraLarge",
            "style": {
                "backgroundImage": "linear-gradient(#F5A9AA, #E97EA3)",
                "box-shadow": "0 1px 3px 1px rgba(58,67,86,0.1)",
                "padding": "50px"
            },
            "items": [
                {
                    "type": "TextBlock",
                    "horizontalAlignment": "center",
                    "size": "large",
                    "weight": "bold",
                    "text": "SERVICING 360"
                },
                {
                    "type": "TextBlock",
                    "horizontalAlignment": "center",
                    "size": "medium",
                    "spacing": "small",
                    "text": "Open BloX Editor to customize filters"
                }
            ]
        },
        {
            "type": "Container",
            "spacing": "extraLarge",
            "width": "200px",
            "Alignment": "center",
            "style": {
                "backgroundImage": "linear-gradient(#F5A9AA, #E97EA3)",
                "box-shadow": "0 1px 3px 1px rgba(58,67,86,0.1)",
                "padding": "20px"
            },
            "items": [
                {
                    "type": "TextBlock",
                    "horizontalAlignment": "center",
                    "size": "medium",
                    "weight": "bold",
                    "text": "SERVICING 360"
                }
            ]
        }
    ],
    "actions": [
        {
            "type": "JTD",
            "title": "Contact Sense Overview",
            "data": {
                "dashboardId": "630c9f049136994110e2ee6f",//jumpto  dashboard id
                "filters": [
                    {
                        "filterName": "Stage",
                        "filterJaql": {
                            "explicit": true,
                            "members": [
                                "Prospect"
                            ]
                        }
                    },
                    {
                        "filterName": "Days in Date",
                        "filterJaql": {
                            "last": {
                                "count": 7,
                                "offset": 0
                            }
                        }
                    }
                ]
            }
        },
        {
            "type": "Filters",
            "title": "Calls by Number of Topics",
            "data": {
                "filters": [
                    {
                        "filterName": "Stage",
                        "filterJaql": {
                            "explicit": true,
                            "members": [
                                "Prospect"
                            ]
                        }
                    },
                    {
                        "filterName": "Risk Level",
                        "filterJaql": {
                            "from": 4
                        }
                    }
                ]
            }
        },
        {
            "type": "Filters",
            "title": "Top Topics",
            "data": {
                "filters": [
                    {
                        "filterName": "Stage",
                        "filterJaql": {
                            "explicit": true,
                            "members": [
                                "Prospect"
                            ]
                        }
                    },
                    {
                        "filterName": "Days Open",
                        "filterJaql": {
                            "from": 90
                        }
                    }
                ]
            }
        },
        {
            "type": "Filters",
            "title": "Pair Topics",
            "data": {
                "filters": [
                    {
                        "filterName": "Stage",
                        "filterJaql": {
                            "explicit": true,
                            "members": [
                                "Prospect"
                            ]
                        }
                    },
                    {
                        "filterName": "Days Open",
                        "filterJaql": {
                            "from": 90
                        }
                    }
                ]
            }
        }
    ]
}

 Thanks

Sijo