Forum Discussion

Roman-Korovets's avatar
Roman-Korovets
Frequent Visitor
3 years ago

Using measures data inside "Formattng settings"

Hi there,
Could you tell me if it is possible to create a measure bucket inside "formatting panel options"?

 

I'm trying to get separate data lists from 2 different tables, but I'm not sure if it is possible.
For example, we have 2 independent tables "Tasks" and "News dates".

I would like to get data like as 2 independent arrays: 

"[ ... TasksData],

"[...newsData]".

 

dm-p, could you help me with it? Or any idea? ๐Ÿ™๐Ÿ™

4 Replies

  • dm-p's avatar
    dm-p
    Super User

    Hi Roman-Korovets,

     

    The property pane only supports measures added via conditional formatting, which are scalar values and bound to objects in the data view. It would not be possible to have a table or array-valued result unless you create a measure that serialises your data into something you could deserialise once you have recieved the property (e.g. a comma-separated list using CONCATENATEX that you could split into an array via JS).

     

    The "right" way to do this via the SDK would be to create data roles for each measure and model your data so that all values could be part of that query and mapped once you process the data view. This of course means that your users may have to have very specific requirements as to how they model data for your visual.

     

    Regards,

     

    Daniel

  • dm-p

    Thank you so much for detailed answer   ๐Ÿ˜Š

     

    To be honest, I'm not sure If I have chosen the correct way for achieving separate lists.
    Could you tell me if exists any way to avoid duplication around data mapping from different tables.
    For now, I have โ€œ1 taskโ€ and โ€œ5 eventsโ€,
    In the result, we see task โ€œ5 times" instead โ€œ1 timeโ€.

     

     

    I would like to have 2 separate lists, if it is possible:
    "tasks" - 1 item
    "events" - 5 items

     

     

    I guess reason is in dataViewMappings.

     

    Capabilities.json:

     

    {
      "privileges": [],
      "dataRoles": [
        {
          "displayName": "Tasks and Hierarchy",
          "name": "Tasks",
          "kind": "Grouping"
        },
        {
          "displayName": "Start Date",
          "name": "StartDate",
          "kind": "Measure"
        },
        {
          "displayName": "Dynamic event",
          "name": "DynamicEvent",
          "kind": "Measure"
        },
        {
          "displayName": "Dynamic event label",
          "name": "DynamicEventLabel",
          "kind": "GroupingOrMeasure"
        }
      ],
      "dataViewMappings": [
        {
          "matrix": {
            "rows": {
              "for": {
                "in": "Tasks"
              },
              "dataReductionAlgorithm": {
                "top": {
                  "count": 30000
                }
              }
            },
            "values": {
              "select": [
                {
                  "for": {
                    "in": "StartDate"
                  }
                },
                {
                  "for": {
                    "in": "DynamicEvent"
                  }
                },
                {
                  "for": {
                    "in": "DynamicEventLabel"
                  }
                }
              ]
            }
          }
        }
      ],
      "advancedEditModeSupport": 2
    }

     

     

     

    Thank you in advance ๐Ÿค—

    • dm-p's avatar
      dm-p
      Super User

      I think with a matrix data view, you're confined to the row/column/cell combination for each data point and probably can't do much to change or manipulate the grain.

       

      I know that Charticulator had some data modelling instructions  for ensuring a degree of compatibility to the web app (which had a main dataset and one for node relationships), but this uses the categorical mapping, so I'm not sure if you could get simialr results, but could be worth a look.