cancel
Showing results for 
Search instead for 
Did you mean: 

Blox Widget - Empty Cells Add in Zero

rvickersevotix
9 - Travel Pro
9 - Travel Pro

I'm putting together a very simple blox transposed widget and I was wondering if there is a way to avoid this scenario where the cells that have no values are making the table skew.

 

Screenshot_103.png

My code is:

 

 

{
    "style": "",
    "script": "",
    "title": "",
    "showCarousel": false,
    "body": [
        {
            "type": "Container",
            "style": {
                "padding": "5px"
            },
            "items": [
                {
                    "type": "TextBlock",
                    "id": "",
                    "class": "",
                    "text": "<style>blox.widget-body .content div div.blox-slides + div.blox-slides div.valueTitle{display:none} blox.widget-body .content > div {overflow: scroll !important; white-space: nowrap !important; margin-left:10px; margin-top: 10px}</style>"
                },
                {
                    "type": "TextBlock",
                    "id": "",
                    "class": "",
                    "text": "{panel:Months}",
                    "size": "default",
                    "weight": "bold",
                    "horizontalAlignment": "right"
                },
                {
                    "type": "ColumnSet",
                    "spacing": "small",
                    "separator": true,
                    "style": {
                        "padding-top": "5px",
                        "padding-bottom": "5px"
                    },
                    "columns": [
                        {
                            "type": "Column",
                            "class": "valueTitle",
                            "style": {
                                "flex": "none",
                                "min-width": "140px"
                            },
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "id": "",
                                    "class": "valueTitle",
                                    "text": "RFR"
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "style": {
                                "flex": "none",
                                "min-width": "130px"
                            },
                            "separator": true,
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "id": "",
                                    "class": "",
                                    "horizontalAlignment": "right",
                                    "text": "{panel:RFR}"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "separator": true,
                    "style": {
                        "padding-top": "5px",
                        "padding-bottom": "5px"
                    },
                    "columns": [
                        {
                            "type": "Column",
                            "class": "valueTitle",
                            "style": {
                                "flex": "none",
                                "min-width": "140px"
                            },
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "id": "",
                                    "class": "valueTitle",
                                    "text": "Incident Count"
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "style": {
                                "flex": "none",
                                "min-width": "130px"
                            },
                            "separator": true,
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "id": "",
                                    "class": "",
                                    "horizontalAlignment": "right",
                                    "text": "{panel:Incident Count}"
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "separator": true,
                    "style": {
                        "padding-top": "5px",
                        "padding-bottom": "5px"
                    },
                    "columns": [
                        {
                            "type": "Column",
                            "class": "valueTitle",
                            "style": {
                                "flex": "none",
                                "min-width": "140px"
                            },
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "id": "",
                                    "class": "valueTitle",
                                    "text": "Deaths"
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "style": {
                                "flex": "none",
                                "min-width": "130px"
                            },
                            "separator": true,
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "id": "",
                                    "class": "",
                                    "horizontalAlignment": "right",
                                    "text": "{panel:zero}"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "actions": []
}

 

 

 

Screenshot_104.png

I dont have access to the DB to Assume a 0 in place of a null and I have tried an IF statement to replace If(X>0,X,0) but that doesnt seem to be working either.

If statement I tried:

if(
  ((([# of unique EntityReference],[IncidentType_id]) *200000)
  /
  sum([Key], [Max ManHours]))>0,
  (([# of unique EntityReference],[IncidentType_id]) *200000)
  /
  sum([Key], [Max ManHours])
  ,0)
 

any help greatly appreciated.

0 REPLIES 0