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()
SWilyums
2 years agoContributor
Hello Sai,
There is no data that meets the criteria of my sample filter. Upon further validation, when the filter gets a hit then it is applied. However, when the filter does not get a hit then all data is returned. I would think it would return a message saying no records or no data. It becomes useless to me if that is not a configurable option. Suggestions?
FredLucas
OneStream Employee
2 years agoHi 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()
Related Content
- 3 years ago
- 4 years ago