cancel
Showing results for 
Search instead for 
Did you mean: 

Filter with less than Operator

rohit3611
Contributor
0 Kudos

Hello Experts,

In the FlatternedDataSet, passing the filter values with the data, The most of filter operators are working leaving some like Less than, If i use the operator less than and  75, still it is showing values like 100.

Has someone faced this issue?

Best regards,

Rohit

Accepted Solutions (0)

Answers (1)

Answers (1)

saivellanki
Active Contributor
0 Kudos

Hi Rohit,

Less than operator is working fine for me. Please check the working sample here - JS Bin - Test Chart Filter


Regards,

Sai Vellanki.

rohit3611
Contributor
0 Kudos

Hi Sai,

Once i use my data and do this, there is a error.

this.dataset.getBinding("d/results").filter(ofilter, "Application");

Uncaught TypeError: Cannot read property 'filter' of undefined

    at eval (eval at evaluate (unknown source), <anonymous>:1:37)

    at Object.InjectedScript._evaluateOn (<anonymous>:905:55)

    at Object.InjectedScript._evaluateAndWrap (<anonymous>:838:34)

    at Object.InjectedScript.evaluateOnCallFrame (<anonymous>:964:21)

Even this.dataset.getBinding("d/results") is coming as undefined.

Best regards,

Rohit

saivellanki
Active Contributor
0 Kudos

Hi Rohit,

It should be this.dataset.getBinding("data").filter(ofilter, "Application");

Regards,

Sai Vellanki.

rohit3611
Contributor
0 Kudos

Hi Sai,

My data is like



  1. d: {,…}
    1. results:
  2. AcceptedCount: 1
  3. Country: ""
  4. DestinationLocation: "1291300003"
  5. Guid: 0
  6. LocDesc: ""
  7. Mtr: ""
  8. OpenCount: 0
  9. PerAccpetance: "100"
  10. PostCode1: ""
  11. PrimaryCarrier: ""
  12. Scac: "TPQL"
  13. SourceLocation: "US88"
  14. TorType: ""
  15. TotalCount: 1


  16. Putting a filter on PerAccpetance for LT 75, It is showing 100 value too.
saivellanki
Active Contributor
0 Kudos

Hi Rohit,

Flattened Dataset -


  var dataset = new sap.viz.ui5.data.FlattenedDataset({

    dimensions : [

      { axis : 1, name : 'SourceLocation', value : "{SourceLocation}" },

      { axis : 2, name : 'DestinationLocation', value : "{DestinationLocation}" }

    ],

    measures : [

      { name : 'PerAcceptance', value : '{PerAcceptance}' }

    ]

  }).bindData("/d/results", null, null, []);

Filter -


var ofilter = new sap.ui.model.Filter("PerAcceptance", sap.ui.model.FilterOperator.LT, 75);

On click of button press logic -


  var oButton = new sap.m.Button({text:"Less than 100", press:function(oEvent){

  dataset.getBinding("data").filter(ofilter, "Application");

  }});


Have you done like the above Rohit?


Regards,

Sai Vellanki.

saivellanki
Active Contributor
0 Kudos

Rohit,

dataset.getBinding("data") - Here 'data' is an aggregation of dataset, it is not your model name. So, as I already mentioned use this.dataset.getBinding("data").filter(ofilter, "Application");


For more information, check the code that I provided in my previous reply.

Regards,

Sai Vellanki.