spotfire limit row count of a table visualization - spotfire

I am trying to limit the number of rows displayed on the visualization by having a property control(input field) in the text area. I was able to create the property control but wondering how to actually apply in the properties window under "Limit data using expression". Is there a way I can specify like RowCount = ${LimitRows} where the LimitRows would be my property control.

Assuming LimitRows is a numeric property (integer, real etc.) you can use the expression below to limit the data.
rowid()<=${LimitRows}

Related

Odoo 12- Is it possible to change the number of select options of a selection field based on value of another field?

I am developing a module for processing Loan Request for our business and I need to have different select options for a selection field based on another field's value. Is it possible to change the select options of this field based on other field value? I tried to use #api.onchange but I couldn't get the desired result.
No.
It's possible, however, to change the domain for a relational field:
#api.onchange("field1")
def _onchange_field1(self):
desired_domain = self._get_domain_for_field2()
return {"domain": {"field2_id": desired_domain}}
That would possibly fit your use case if you use a Many2one instead of a Selection field.

Concatenated SQL fields in selector and/or custom PXDimension

We have a set of BLC/DAC for a customization that has multiple tables with the given relationship
Table1 - T1ID (int-autoincrement), T1CD (char-substitute key)
Table2 - T2ID (int-autoincrement), T2CD (char-subsitute key), T1ID (reference to T1ID)
where the records in Table2 are unique for each given T1ID selected.
The initial design specification was for the users to select first the Table1 value, then the Table2 value (UsrTable1Value, UsrTable2Value respectively) in the data entry screens.
The users have recently asked if it's possible to combine these into one field simular to a Dimension selector so that there is one field resulting in "Table1-Table2" stored as T2ID.
My first thought was to simply create a subclassed dac with a concatenated property for T1CD-T2CD and base the substitute key off that however performance is a problem when that is done (1.6 million records). The delay is in the framwork side as it appears it processes the entire recordset when generating the concatenated substitute key.
Based on that I thought perhaps instead to simply generate a PXDimension configuration for this however I can't find any reference to make Dimension 2 rely on the value of Dimension 1.
I know i could always create a view that does this but i'd prefer to keep it within the framework if possible.
That basically brings me to two questions
1) Outside of a view, is there way to concatenate fields in the BQL so the lifting is done on the SQL and not with a calculated property?
2) Does anyone have or know of a sample of custom Dimensions where the values in level 2 depend on the value in level 1?
Any suggestions would be appreciated.
Out of the box, dimension selectors are designed to work only with Segmented Keys and won't be able to handle values from multiple tables. In theory, it can be possible to populate segment popup from different tables within a custom DimentionSelectorAttribute. However, this will additionally require to store each T1ID/T2ID pair in a separate table with some other column declared as a key (same concept used in the Sub table to store sub accounts: SubID is a key and SubCD stores values composed from multiple segments).
My personal opinion, the effort is just not worth it. Going one step further, I would check with the customer on how they expect navigation buttons (first, prev, next, last) to work with their segmented input control? If following standard Acumatica UI design with separate input created for every key field, no additional effort is needed to properly handle both data entry and navigation.

Spotfire: how to access calculated value programatically

So, for example to access/change the "limit data using expression" property corresponding to a barchart I do:
from Spotfire.Dxp.Application.Visuals import BarChart
chart1 = Viz.As[BarChart]()
filter = '[CS_AGE] Is Not Null'
chart1.Data.WhereClauseExpression = filter
My question is: how can I access the "limit data using expression" property corresponding to a calculated values (The ones you create in a text filed using "insert dynamic item>calculated values")
there's probably a way to directly modify a control via the API if you know its ID (which you can get by adding the control and then looking at the HTML of its parent textarea), but I don't know what it's called.
that said, if you just need to change the expression being used for a Calculated Value, it'd be much simpler to use a Document Property instead. in your script, you can use
Document.Properties["MyPropertyName"] = "[Column] > 100"
and then in your Calculated Value (and any charts using the same limit), set the data limiting expression to
${MyPropertyName}

Spotfire - Adding dynamic date restriction to data table which is based on an information link. Spotfire 6.0.1

I have an information link that I want to restrict in spotfire when I add it as a data table so that certain data is excluded. I want to restrict column 'DAY' to the past 91 days.
These are the steps I have tried that haven't worked:
Added data table and clicked 'load on demand' (in the 'Add Data Tables' window) and then 'settings'
On the 'DAY' column, clicked 'Define Input'
Chose 'Range(fixed/properties/expression)' as the 'Input' for the selected parameter
Then as the 'expression' for the 'Min', used: DateAdd('dd',-91,DateTimeNow())
It returns an error when I try to add a transformation to the data or just returns no data when I add the data table. If I just restrict the data with a fixed value it works as expected but clearly this would mean that I would need to change the restriction everyday. I have also been able to restrict the data to a static date directly on the information link under the 'Filters' heading. What I really need is a dynamic restriction that is placed on in some way, in Spotfire, rather than directly on the data source (Oracle).
Would be grateful for any help! Thanks!
It couldn't recognize DateTimeNow(), which is a DateTime as a Date. Spotfire gets kind of picky about that sort of thing.
Replace the Expression used for Min with
DateAdd("dd",-91,Date(DateTimeNow()))
and it should work.

How does CRM 2011 auto-wire the StringMapBase table in for Option List picks in Advanced Finds?

The StringMapBase SQL table is the table that holds Option List values that have been added to an entity. When using an Advanced Find in CRM 2011, if you select a pick list column (Option List) value from an entity to be added to the resultset, the Advanced Find mechanism somehow auto-wires in the string value of the pick list from the StringMapBase table instead of showing the StringMapBase's Primary Key value that's actually stored on the record.
I'm in the process of creating SSRS reports that hinge on some Option List values:
// SQL psuedocode
Select...
...
Where Value = 'Some String Value of Interest'
However, I very much dislike the fact that, so far, it looks like I basically have to write in some ad-hoc SQL in order to get the applicable StringMapBase value. In order to do so, I have to hard-code some magic values, which I despise.
Does anyone know by what mechanism the CRM Advanced Find engine auto-wires these values in? Or does it simply do its own join to the StringMap system view or use a SPROC somewhere?
When you use the Filtered views (the only supported way to read data in your report) there will be an additional "logical" column for Bit, Picklist, and Lookup columns. For an attribute named "new_option" you should be able to add "name" to the end of the column name and query "new_optionname".
select new_option, -- Integer
new_optionname -- StringMap joins generated by Filtered Views
from Filterednew_test

Resources