Thanks Asgallant. I am using method #1 On Friday, December 7, 2012 12:36:44 AM UTC+5:30, asgallant wrote: > > How this behaves depends on what you are actually filtering. You need to > filter a base data set and then set the rows of a DataView based on that > data set. If you filter the DataView, you can't use the returned rows to > set the rows in the DataView again (as the array of rows will contain the > row indices in the DataView, not the underlying DataTable). You would have > to do one of three things: > > 1) translate the array of DataView row indices into DataTable row indices > (via the DataView#getTableRowIndex method), or > 2) create a new DataView based on the current DataView, and set the rows > in the new view, or > 3) add the new filter to a filter array, and refilter the base DataTable > again, using all filters > > Method 2 could get rather complicated for an arbitrarily large number of > filters. Method 1 requires more code than method 3, but is potentially > more efficient for filtering very large data sets. > > This can get complicated for arbitrarily large numbers of filters, though, > so I would suggest keeping track of all filters, and filtering the base > data using all filters > > On Thursday, December 6, 2012 2:03:21 AM UTC-5, Vikas NV wrote: >> >> Hi, >> >> I need to understand how the getFilteredRows behaves in this scenario: >> 1. apply a getFilteredRows with a numeric min & max for a column that >> has numeric values >> 2. do a setRows from the row indices i get from 1st step (these are >> applied min & max->min: 10000 & max: Max in that column) >> 3. apply a getFilteredRows again with a numeric min & max for a column >> that has numeric values (on a column other than that i applied in step 1) >> 4. do a setRows from the row indices i get from 3rd step (these are >> applied min & max->min 1.05 & max: Max in that column) >> >> Now i expect that the second getFilteredRows will act on the rows that >> were there after i did setRows from 2nd step >> >> Am i right? I do not see this behavior though .. i mean even though i >> applied 1.05 as min for filter in 4th step i see values that that <1.05 >> But if i apply only the filter in 3rd step first (without any other >> previously) .. it works fine >> >> What i do for applying filter is this-- >> . get column, min & max from user >> . do getFilteredRows & get the row indices >> . then setRows by passing row indices i get from previous step >> >> Thanks, >> Vikas >> >
-- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/Ejkd-qYq244J. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
