Query Entity Logic

Hi,

 

I will be having two columns in my table minValue,Maxvalue.when i pass an input to the table it should return the lookup value in the attached screen shot.

Lets say if i pass a value 0.25, the value 0.25 is in between 0 and 0.5 in attached screen shot, it should return me 100.

 

What should be my query logic in this case?

 

Attached is the code , but this logic is wrong  because the logic should be written in reciprocal to this.

 

Please help with this , any creative way of creating the table table structure are also welcome.

 

 

a!queryEntity(
entity:cons!ENTITY,
query:a!query(
logicalExpression:a!queryLogicalExpression(
operator:"AND",
filters:{
a!queryFilter(
field:"minValue",
operator:">=",
value:0.25
),

a!queryFilter(
field:"maxValue",
operator:"<=",
value:0.25
)

}),

pagingInfo: a!pagingInfo(1,1)
)
)

  Discussion posts and replies are publicly visible

Parents
  • Hi Karthik,

    Please find the below code


    a!queryEntity(
    entity:cons!ENTITY,
    query:a!query(
    logicalExpression:a!queryLogicalExpression(
    operator:"AND",
    filters:{
    a!queryFilter(
    field:"minValue",
    operator:"<=",
    value:ri!num
    ),

    a!queryFilter(
    field:"maxValue",
    operator:">=",
    value:ri!num
    )

    }),

    pagingInfo: a!pagingInfo(1,1)
    )
    ).data

    this might met your requirement.
Reply
  • Hi Karthik,

    Please find the below code


    a!queryEntity(
    entity:cons!ENTITY,
    query:a!query(
    logicalExpression:a!queryLogicalExpression(
    operator:"AND",
    filters:{
    a!queryFilter(
    field:"minValue",
    operator:"<=",
    value:ri!num
    ),

    a!queryFilter(
    field:"maxValue",
    operator:">=",
    value:ri!num
    )

    }),

    pagingInfo: a!pagingInfo(1,1)
    )
    ).data

    this might met your requirement.
Children