Filter Datagrid column on multiple values

Arnab Dutta shared this question 5 years ago
Answered

Hi,


How do I filter a datagrid column on a set of values? for e.g in the below expression, I want the result to return all rows from DM where field1 matches the value of field2 of the datagrid. (trying to simulate a SQL join)


filter('DM', DM.field1 = (select(datagrid row,field2) )


Thanks,


Arnab

Comments (3)

photo
1

Just to add, the above expression does select all matching values to field1 from DM, however they are returned as a single row value separated by commas. This is what I want:


Datamaster 1:


1,A


1,B


2,C


2,D


2,E


3,A


3,F


Datagrid:


H,1


K,3


O/P Required in Result Datagrid (Filter Column 1 of DM1 against Column 2 of Datagrid):


1,A


1,B


3,A


3,F


So what kind of expression can be created for the result datagrid?


Thanks

photo
1

Hi Arnab,


You can do the following:


1. Create two datamasters, in your case Datamaster1 and Datagrid. Add a data grid into the canvas. Select the Datamaster1 and click ok.


2. Create an "on page load" event and select set value.


3. Now, click on the datagrid and calculate the following expression:


a35dadef676d3989ea524352ca4b684c


In my case, "test" is your datamaster1 and "test2" is your small datagrid (H,1; K,3). "number2" is from "test2" and "number" is from "test"


I hope it helps you

photo
1

Thanks a lot Albert. It worked.