DBR with comma in element name


#21

Hi @rcantor,

Looking again at the your elements list it is failing because you are using single quotes around the property name as well as around the full elements string. You will need to use double-quotes around the property name: {{$ctrl.settings["Dim Year"]}}. It should now look like this (not tested):

<tm1-ui-dbr
        tm1-instance="c3"
        tm1-cube="Workflow Status"
        tm1-elements='{{$ctrl.settings["Dim Year"]}}, B, Scenario, "{{$ctrl.settings["Dim Product"]}}", {{$ctrl.settings["Dim Country"]}}, Status'
        ng-model="model_node_status"
        >
    </tm1-ui-dbr>

In your last example you haven’t put double-quotes around the element as @plim suggested.


#22

Hi @tryan

I tried all the possible combinations of single and double quotes, but nothing works.
The one below is tailored exactly after your example.

<tm1-ui-dbr
        tm1-instance="c3"
        tm1-cube="Workflow Status New"
        tm1-elements='{{$ctrl.settings["Year"]}}, B, Budget, "{{$ctrl.settings["Product"]}}", "{{$ctrl.settings["Entity"]}}", Status'
        ng-model="model_node_status"
        >
    </tm1-ui-dbr> 

If I remember correctly, this issue is also happening in the Cubewise Timesheet application, when you try to upload from Excel and one of the project codes contains a comma


#23

Hi @rcantor,

I am still unable to replicate this. I even tried with the exact name of the elements, via alias, that you were passing:

Here is my DBR:

<p>Dim Product -> {{$ctrl.settings['Dim Product']}}</p>
<p>Year -> {{$ctrl.settings['Year']}}</p>
<p>Entity -> {{$ctrl.settings['Entity']}}</p>
<p>
  <tm1-ui-dbr tm1-instance="dev" tm1-cube="General Ledger" tm1-elements='1,2014,"{{$ctrl.settings["Year"]}}","{{$ctrl.settings["Entity"]}}",1,1,"{{$ctrl.settings["Dim Product"]}}",Amount'></tm1-ui-dbr>
</p>

What TM1 version are you using this with? What are the errors that you are seeing in the console?

Does hard coding the values work on your page? If this works, then how are you retrieving the Dim Product value? I noticed that you were using and assigning it to the controller. Can you post in here that section of code on how you set values into it?


Paul


#24

Hi @plim

I retested everything from scratch, and you are right. Using double quotes works fine.
It was our mistake when we originally tested the fix.

The following code works fine.

<tm1-ui-dbr-hidden
      tm1-instance="c3"
      tm1-cube="Workflow Status New"
      tm1-elements='{{$ctrl.settings["Year"]}}, B, Budget, "{{$ctrl.settings["Product"]}}", {{$ctrl.settings["Entity"]}}, User Can Reserve Product Only'
      ng-model="model_user_can_reserve"
      >
  </tm1-ui-dbr-hidden>