-
Posts
17 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Vanessa Virginia Sucre Gonzalez's Achievements
-
log in in data source in my pc only
Vanessa Virginia Sucre Gonzalez replied to Enkeled Kanaj's topic in Spotfire
Go to Data > Data Connection Settings > Data Connection > Credentials -
log in in data source in my pc only
Vanessa Virginia Sucre Gonzalez replied to Enkeled Kanaj's topic in Spotfire
-
If you want a more efficient code (instead of checking every X seconds, you could use this one to be launched every time the calculated value changes. //this is the target element to monitor changes //just put the span id here. You can remove next line and add a script param called targetDomId var targetDomId = "calcVal" //no need to change after this line. var target = document.getElementById(targetDomId) //callback is the function to trigger when target changes var oldVal = target.innerText.trim() var callback = function(mutations) { newVal=$("#calcVal").text().trim(); if(newVal!=oldVal){ $("#inputPropertyControl input").val(value).blur(); } oldVal = newVal; } //this is to glue these two together var observer = new MutationObserver(callback); var opts = { childList: true, attributes: true, characterData: true, subtree: true } observer.observe(target,opts);
-
Hi @achen1, I would create a calculated value (filtered by the corresponding filter scheme) with a RowCount() expression. This value will be pass to a document property using javascript. Within the code you will save the value into the document property ONLY when its changes, this way the Iron Python script is triggered. The javascript would be something like this: var oldValue=0 transferValue = function(){ //get value from calcVal spotfire Calculated Value Dyn Item value=$("#calcVal").text().trim() //update input when oldValue changes if(value!=oldValue){ $("#inputPropertyControl input").val(value).blur(); } oldValue=value } setInterval(transferValue,3000) //3 times per second And this your HTML <span id="calcVal" style="display:none"><SpotfireControl id="95ca117d24b347a6923498cf495fb245" /></span> <span id="inputPropertyControl" style="display:none"><SpotfireControl id="b98bc60cd1824746aacd1e1a747f42f9" /></span> Your calculated value calcVal changes every time you change a filter in the filter panel And the document property inputPropertyControl will store that value and run the sccript
-
extracting values from datatable by index
Vanessa Virginia Sucre Gonzalez replied to achen1's topic in Spotfire
Hi @achen1 Could this script work for you? from Spotfire.Dxp.Data import * from Spotfire.Dxp.Application.Visuals import * #setup rows to select from rows to include rowCount=table.RowCount rowsToInclude = IndexSet(rowCount, True) # Create a cursor to the Column we wish to get the values from cursor = DataValueCursor.CreateFormatted(table.Columns["myCol"]) # Loop through all rows, retrieve value for specific column, # Get the first value from the column for row in table.GetRows(rowsToInclude, cursor): rowIndex = row.Index if rowIndex == 0: myTitleValue = cursor.CurrentValue break; # Get myVis as a Visualization myVis = VisualElement.As[Visualization]() # Show (or hide) the title myVis.ShowTitle = True # Change the title myVis.Title = 'My New Title has this value -> ' + myTitleValue -
Hi @achen1 You'll have to create a calculated column with the filtered values, and use that one for your combobox. You'll need some scripting, both IronPython and Javascript. I made a quick example for you :) you have a Region List that filters the Country Name Combobox. If you have any questions please let me know! filtered Combobox.dxp
-
Hi, Just go to the main panel, select filter Now, add the column directly from the data source table: You have to change the expression (1% is mandatory, it's your column's placeholder). I see you are using Oracle, so the expression would be %1 - 1 Now you save the filter, and add it to your information link:
-
Vanessa Virginia Sucre Gonzalez changed their profile photo
-
How to sort a table by Marked rows?
Vanessa Virginia Sucre Gonzalez replied to RJain's topic in Spotfire
Hi @RJain I created an IronPython script to sort table visualisations with marked rows in first position with no need of an extra Sort By column. The script first creates a Custom Sort Order (this will ONLY apply to String data columns). Once the Data column is sorted, you apply it directly to the visualisation (In this case, our data table, but you could use any type). Here I leave the code and a dxp with the working example: from System.Collections.Generic import List from Spotfire.Dxp.Data import * from System.Reflection import Assembly from Spotfire.Dxp.Data.Collections import * from System.Runtime.Serialization import ISerializable from System.Collections import IComparer from System.Collections.Generic import IComparer from Spotfire.Dxp.Application.Visuals import * class MarkData: def __init__(self, value, mark): self.value = value self.mark = mark def __repr__(self): return repr((self.value, self.mark)) cursor = DataValueCursor.CreateFormatted(dataTable.Columns["ATA"]) markings = Document.ActiveMarkingSelectionReference.GetSelection(dataTable) markedata = [] for row in dataTable.GetRows(markings.AsIndexSet(),cursor): value = cursor.CurrentValue markedata.append(MarkData(value, 1)) for row in dataTable.GetRows(markings.AsIndexSet().AsWritable().Not(),cursor): value = cursor.CurrentValue markedata.append(MarkData(value, 0)) sortedMarkedata = sorted(markedata, key=lambda value: -value.mark) sortList = List[str]() for item in sortedMarkedata: sortList.Add(item.value) print(item.value) dataTable.Columns["ATA"].Properties.SetCustomSortOrder(sortList) myVis = myVis.As[Visualization]() dataTable = myVis.Data.DataTableReference myVis.SortInfos.Clear() myVis.SortInfos.Add(dataTable.Columns.Item["ATA"], TablePlotColumnSortMode.Ascending) PARAMETERS: myVis -> Data Table Visualisation dataTable -> Your Data table with the Column you want to sort Please let me know if this solution works for you :) Sort By Marking.dxp -
Vanessa Virginia Sucre Gonzalez started following Cecilia Garofalo
-
Hi Cecilia, You could try (if it's ok for you) to disable the mod trust validation: 1. On the Spotfire Server machine, open an Administrators command prompt and move to <TSS Installation Directory>/tomcat/spotfire-bin 2. Export current configuration through the command (Windows) ./config.bat export-config -t TOOL_PASSWORD 3. Set the configuration property through the command: (Windows) ./config.bat set-config-prop -n "security.code-trust.validate-uploaded-cert" -v "false" 4. Import the updated configuration to the database through the command: (Windows) ./config.bat import-config -c "comment your change" -t TOOL_PASSWORD 5. Restart the server. Also, check if the Automation Services User is able to trust mods. Regards,