Hi
how can i write above query in ER?
can anyone help me with this?
i have tried but it gives error
Discussion posts and replies are publicly visible
In the "Value" field, you need to remove the double quotes and add ri! instead. What you have done right now is you are comparing an Integer field (groupCif_int) with a string ("liabilityNumber_int"). So instead of "liabilityNumber_int" it should be ri!liabilityNumber_int
i have tried with that also
when i given ri it is not filtering all data it is giving
so can you please let me know how can i write ER for this query
what is the datatype for GCIF and Liability_Number?
all are integer - gcif, cif, liability_number
a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "GCIF", operator: "=", value: ri!gcif ), a!queryFilter( field: "LIABILITY_NUMBER", operator: "=", value: ri!liabilityNumber ), a!queryFilter( field: "CIF_TYPE", operator: "=", value:"Parent" ) })
please replace your code with the above one and add two rule input variables 1) gcif number(integer) 2) liabilityNumber number(integer). I am not sure why you took GCIF 2 times in where conditions.
I have taken a look and that is what I am suggesting. You have configured it incorrectly. Please take a look the screenshots above and try the suggested approach.
this is how i get data from that query
so in this data i'll give one gcif data and will get only that row
this is what i required from ER
so i have used 2 gicfs
and this will give me all the rows in this i have to filter it
in the screenshot, GCIF,Liability_Number and CIF is same for all. Then please use the below expression for the querylogicalExpression.
Note: you have to change the field name(GCIF, CIF_TYPE) in the code. for the please refer your cdt. Rule input GCIF is of integer type.
a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "GCIF", operator: "=", value: ri!gcif ), a!queryFilter( field: "CIF_TYPE", operator: "=", value:"Parent" ) })
For reference:
It seems like the fields do not match. And when you configure it to ignore any filter having no values, then pass no value, this filter will be ignored and you get more items than expected.
Make sure to use the right rule inputs for each field and either pass values or switch off "ignoreFiltersWithEmptyValues".
even i have checked this also.. this give wrong data
if i don't apply the filters like GCIF=LIBAILITY and LIABILITY=CIF filter there might be chances of LIABILITY value will have different
for ex when i apply GCIF=LIBAILITY and LIABILITY=CIF filter then output will be
GCIF=102646 and LIABILITY=102646 and CIF=102646
when i don't apply GCIF=LIBAILITY and LIABILITY=CIF this filter and apply only GCIF=CIF then output will be
GCIF=102646 and LIABILITY=735838 and CIF=102646
in this case how to overcome
Then you can give 3 input and the filters for the same.
I can't really help with this.
When I approach stuff I have a hard time understanding, I try to do small steps, test and validate each step and try to understand what is going on.
Exactly. You need to implement a code logically and also need to understand how to deal with that code.