how to create dynamic filter in text area of spotfire - spotfire

I want to create a dropdown in text area to filter data in table dynamically.
I have many entries under Filter "Task Description".
But I want to create a dropdown in text area with only below three entries out of all entries.
All - it will show the entire data
Prasanta - this selection will only show Prasanta related rows
Chandan - this selection should only show Chandan related rows.
Is it possible?

the best and simplest way to do this is with a Text Area visualization containing a Property Control. I'll give you a loose outline and you can use the Spotfire help on Property Controls to get more detail.
add a new Property Control of type Drop-down list to a Text Area
create a new Document Property of type string
set the property value through Expressions
the expressions you list here should evaluate to boolean true or false. for example, for Prasanta rows you might use [Task Description] = "Prasanta". the expression for All rows should be blank.
on the Data page of the filtered visualization's Properties, scroll down to Limit data using expression and click Edit...
from the middle pane, double click the name of the Document Property you created in step 2 above
test by selecting different items from the dropdown you created

Related

Force user to select only one value from filter spotfire

Is it possible to force the user to select only one value from a filter ?
For a radio button filter as below, is it possible to remove the buttons all & none and make sure that only one Choice is selected ?
you cannot change the existing filter features or functionality without developing a custom extension for a new filter control.
that said, you can certainly emulate a filter using what's called a Property Control and a Data Limiting Expression. for single selection, you're stuck with either a Dropdown control or a Listbox (single select) control.
you would need to...
create a Text Area Visualization on the page somewhere
insert a Listbox or Dropdown Property Control into the Text Area Visualization
create a Document Property with the same data type as your filter column and associate it to the Property Control. you can set this to Unique Values in Column or write in your own Fixed values.
open the Properties dialog on the visualization you'd like to filter and navigate to the Data page
scroll down to Limit Data Using Expression and use an expression like [MyFilterColumn] = "${MyDocumentProperty}" (quotes are required for string values; if numeric then omit quotes)
Please add this CSS in the HTML page of the spotifre to remove all and none
.ColumnFilter .sf-element-filter-item:last-of-type { display:none; }
.ColumnFilter .sf-element-filter-item:first-of-type { display:none; }
Another way to force the users to select one option is to add a Show/Hide in the visualization like this: Hide if UniqueCount([Field]) is greater than 1

ms excel - data validation for 2 drop down list

I'm looking for the solution in excel data validation for 2 drop down list.
When I choose 1st drop down list 2nd drop down list will auto populate the correct value from table. If user choose 2nd drop down list 1st drop down list will auto populate the value also.
Can someone help me on this issue ?
I attach the sample file for my problem.
enter image description here
enter image description here
thanks!
Sample File
Trying to do a two way I don't think is going to work in the way you are trying so I am not surprised the examples you found were for one-way. I am open to being corrected.
You could hack around it for example using two form control listboxes linked to the same cell so a selection in one updates the other.
Then because an item might be out of view listbox underneath have two cells which use the linked cell to index back into the source lists.
In the example above, there are two list boxes from form controls in developer tab (customize ribbon > add developer tab.
Developer tab form control - 2nd from the right
You add two of these in to the sheet.
Right click format control on each one
Set the input range to the range containing your list of values for that listbox and set the linked cell e.g. G1
Ensure that whilst you select different input ranges for each list box, they should have the same linked cell e.g. G1.
Underneath the listboxes put a formula which uses the linked cell G1 to index back into the source lists for each listbox so you can retrieve the selected value and have it visible, in case not visible within listbox.
Example testing:

Where does Excel store the parameters you pass into Range.Group

This has to do with Pivot Tables.
I am trying use VBA (or C#) to get to some data that's stored in the spreadsheet, but I don't know where it is in the object model. I know the data is in the spreadsheet because when I unzip the spreadsheet, I see it in the pivotcache. The following documentation for OpenXML talks about the field in particular:
https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.rangeproperties%28v=office.14%29.aspx
In the RangeProperties class, see the groupInterval property, in particular.
For instance, the XML shows:
<fieldGroup base="0">
<rangePr startNum="19" endNum="947" groupInterval="656"/>
<groupItems count="4">
<s v="<19"/>
<s v="19-684"/>
<s v="685-1350"/>
<s v=">1351"/>
</groupItems>
</fieldGroup>
But I don't know how to get to this from the Excel object-model at runtime.
The above data represents the entries the user makes in order to group a set of rows in a pivot table. Below are more details on how to get to it.
When you click on Rows of a Pivot Table, you can Group the rows. For instance, let's say you have a thousand rows, but the values range from 1-100. You don't want to see all 1000 rows, just in 10 rows (groups of 100). First group will be a row that aggregates all the rows where the value is between 1-100, the next group for values 100-200, etc.
When you right-click any cell the Row Labels section, and click on the Group item from the context menu, you'll get a small dialog box with "Grouping" in the title bar, and fields:
- Starting at:
- Ending at:
- By:
And there will be a checkbox next to the starting at and ending end fields.
I'll take the defaults, and increment by 100
The equivalent to doing this in VBA (or C# VSTS) is:
Select the cell:
Call the Group() method on the current single-cell selection, eg:
Selection.Range.Group true, true, 100
At this point, the PivotItems associated with the PivotField end up with captions such as "1-100".
Now, if you right-click on the field again and select the Group item, you will get the same dialog box pop-up, with the fields of the dialog box filled in with the previous values you selected for that PivotTable.
However, the information that's used to fill that dialog box doesn't seem to exist anywhere in the object model. I suspect I just don't know where to look.
Does anyone know?
So the basic question in is, when I call the Group method on a single-cell Range object, and pass in various parameters, where are those parameters retained in the object model? I know it's there because Excel itself is able to load it up and it's stored in the spreadsheet.

VBA dropdown selection

Hi i have a worksheet contain six columns, instead of use the Filter function from excel, I would like to create a dropdown menu that allows me to select the information from column A (strings) and then select information from colomn F (also string), how can I create that dropdown from VBA?
Thanks,
Your question isn't fully clear to me in terms of what sort of functionality you want this drop-down menu to have, but you would be best off to investigate the following:
A) Developer Tab > Insert > List Box
You can specify a data range for this drop-down menu and link it to a cell which updates its value based on the drop-down list selection.
B) Data Tab > Data Validation > Allow: List
This allows you to select a list of data that you want to have appear in a particular cell.
Perhaps these would be useful for what you are looking to accomplish.

How to prevent a viewPanel with category filter showing empty rows if filter is not set

I'm having this categorized view displayed in a view panel where the category column itself is not shown. Instead I'm displaying a combobox above the viewPanel where users can select from all the categories available (see screenshot below). The combo is bound to a scopeVariable and is refreshing the viewPanel onChange. The viewPanel has a computed categoryFilter reading from the same scopeVar. That all works nicely.
Now I also have implemented an additional wildcard (*) value in the selection list which (if selected) programmatically sets the cat filter to NULL. This way I'm forcing the viewPanel to show all entries. Again, this works fine, but with the drawback that now the view is showing empty rows where the category entries would be shown normally (in the screenshot you see empty rows above each entry, with 2 entries for the category "edcom GmbH" obviously belonging to the same category; those aren't separated by an empty row):
One way to at least hide those empty rows would be through means of css coding. But I would prefer those rows not being rendered at all.
Can this be done at all using a viewPanel, and how? Or do I have to use other controls like a repeat or a dataTable maybe?
Thanks in advance,
Lothar
One "hack" (an ugly one I admit) would be to change your categorization column from Firma to Firma:"--All--" or Firma:"*" and then instead of setting the category filter to NULL you set it to "--All--" (or "*").
The double category hits the indexer, but should do what you need.
Obviously there's no easy way. So meanwhile I'll stick to this css-style solution:
In the view panel und All Properties - data I set var = "entry". Then, under All Properties - styling I set a programatic value for the rowClasses property:
if(entry.isCategory()){
return "rowStyleHidden";
}
return "";
The style class "rowStyleHidden" hides those rows using
display: none;
Don't know yet how this turns out performance-wise, I'll have to observe this once I implement it in a copy of the real database.
You can also switch to a none categorized view, by having the viewname calculated based on the value in combobox.

Resources