Forum Discussion
Akalya_N
2 years agoNew Contributor
Threshold Operation in FDX using SQL Query
Hi Community...! I want to perform Threshold operation in FDX report using SQL Query.. Anyone who knows please share the format for reference... Thank You...!
- 2 years ago
If you meant that you're running an FDX query and want to see values > 30000 in the returned datatable then you can use the Filter parameter
filter = "Amount > 30000"
BRApi.Import.Data.FdxExecuteDataUnit(si, cubeName, entityMemFilter, consName, scenarioTypeId, scenarioMemFilter, timeMemFilter, viewName, suppressNoData, filter, parallelQueryCount, logStatistics);
- 2 years ago
Hi SWilyums,
You are 100% correct. There is an existing bug - "22557 - FDX Query Filter; When no records match the filter argument, then all data records are returned."
Look for future release notes to find out when it's been resolved or reach out to support for updates.As a workaround, you may want to try the data table select functionality as mentioned by Sai_Maganti or the filtering capabilities offered by the vb.net DataView objects. If it's a big data set and performance is important you may want to try both methods to understand which one would be best in your use case (code sample below):
'Option A: dim dtFilteredRows as DataRow() = dt.Select("Account='A30000' And (UD1 ='D1059' OR UD1 = 'D1061' OR UD1 = 'D1062')") 'Option B: Dim sRowFilter As String = "Account='A30000' And (UD1 ='D1059' OR UD1 = 'D1061' OR UD1 = 'D1062')" Dim sSort As String = String.Empty Dim dview As New DataView(dt,sRowFilter,sSort,DataViewRowState.CurrentRows) dt = dview.ToTable()
Sai_Maganti
2 years agoContributor II
Hmm not sure why it is not honouring the filter..However, you can ignore the filter here and fetch all the data and then do a select on the datatable returned. See above post by OP. The filtering was done outside the fdx using a select.
dim dtFilteredRows() as DataRow = dtFdx.Select("Account='A30000' And UD1 IN ('D1059', 'D1061', 'D1062')")
Best
Sai
Related Content
- 3 years ago
- 4 years ago