First workbook on Public Tableau allows user to hover or select datapoints on two separate maps, and other panels react accordingly (refer to tab Business Ratings)
Two maps are filtered separately, i.e. businesses in Brooklyn are selected in Brooklyn map, businesses in Ludhiana are selected in Ludhiana map, and it worked really well .... so far
Second workbook on Public Tableau adds action to Grade panel. If user hovers over a business, only that business should display on one of the maps.
But the problem, it displays on BOTH maps, which is what I don't want. And when I check the Location(Location) filter, it selects ALL locations, instead of the ones I specified. It's as if adding action to Grade totally wiped out my efforts.
How do I fix this?
I believe I solved my problem.
Before, Grand_Avg was defined as
{ EXCLUDE [Location (Location)] : AVG([Number_Rating]) }
So when I created action to select [Location (Location)], it somehow removed the filters I originally placed on [Location (Location)] for both separate maps.
But now, I defined Grand_Avg as
{ EXCLUDE [Location] : AVG([Number_Rating]) }
And now, I can create action to Hover and Select the Location in Grade panel and it works better. Here is updated workbook.
Related
I am developing a Power App using the Teams version. We have two tables in Dataverse acting as the main data sources. There is an inheritance relationship between these two tables, where one holds parent objects and the other child. I have an overview screen which displays a single record and it is important that a user can select both parent and child records from a single combobox and have the data associated to the selected record displayed.
In order to achieve this I have a collection which holds the ID and Parent/Child type of each record to form a full list of records from both tables. Collection is built as follows:
ClearCollect(Collection_RecordSelect,AddColumns(ShowColumns(record_parents,"recordID","recordID_numeric"),"type","parent")); Collect(Collection_RecordSelect, AddColumns(ShowColumns(record_children,"recordID","recordID_numeric"),"type","child"));
When a user selects a record from the combobox, the ID value from the collection is looked up against the respective data source to get the rest of the data for the record.
The issue I have now is, when a user makes a change to a record in another screen, the app returns to this overview screen to show the record they have just changed. To achieve this I used the DefaultSelectedItems property of the combobox which looks at a selectedRecord variable containing the record ID as a string, set after a user changes the record in another screen. As the combobox requires a record, the combobox uses the selectedRecord variable to Lookup into the collection I referenced earlier to get the full record, unless it's blank in which case it default to the first record. Shown below:
If(IsBlank(selectedRecordID),First(Collection_RecordSelect),Lookup(Collection_RecordSelect, recordID = selectedRecordID))
This results in the combobox displaying two instances of the selected record and showing the old version of the record before the user made changes on the overview screen. If you select another record, the duplicate disappears. If you select the other duplicate record in the combobox, the user's changes are then shown on the overview screen.
Screenshot of duplicate record in combobox.
I have tried creating a single collection, containing all records from both tables, however as they are slightly different due to the inheritance field in the child table they don't merge properly and data is missed. Unfortunately, I need the inheritance field on the overview screen so I can't use ShowColumns and remove it.
I have recently re-built the app in Teams as opposed to standard Power Apps. This solution worked fine in the standard Power Apps environment, so I have a suspicion it may be a bug with the Power Apps for Teams combobox? Unless I am making a mistake, I think this is probably true as I've just tested and the "Classic Control" combobox doesn't have the same behavior, shame because it looks rubbish compared to the Teams one!
I have turned off multi-select on the combobox and search and the problem still exists.
Any help would be hugely appreciated!
I've created a list in Google Sheets that lets the user easily apply custom filters by either entering a search term or selecting an item per column as well as sort by some criteria. Since the document is supposed to be used by multiple people without Google accounts, I'd like anyone to be able to browse the list and apply criteria as straightforward as using Filter Views. However, if I were to publish the spreadsheet as it is now, the filter settings would naturally apply to every viewer of the document.
Is it possible to let viewers use the filters without manipulating the results for the others?
well, for that purpose alone, there was created the "black filter view"
which is local and does not influence original dataset at all, as it does the "green filter view" which acts as global for all users
so now the only obstacle is unawareness of this, of the majority Google Sheet users because black filter view needs to be triggered by each user on his side.
What I am trying to achive is the following:
I have a drop down list with some values from a database. I have some Materials, that I associate to WorkingUnits. So I am able to assign as many Materials as I want to a WorkingUnit, as well as have one and the same material assigned to two different WorkingUnits (in case I want to do so). So far so good, but what I want to achive as extra, is to filter out the already selected materials per working unit so that the user cannot select them again.
Improvised tables relationship:
|Materials|1 --------- * |MaterialWorkingUnitMap| * ----------- 1 |WorkingUnit|
I might be asking for something trivial, but I cannot figure this out so far. Are the relationships wrong in your according to the described behaviour? According to me they make sense, but I am completely new to LightSwitch.
Another solution would be to also include some validation in case the user selects one and the same material. This is the less desired approach, but I guess it satisfies me as well.
I hope this helps.
Go to your Materials table and create a new query called "UnusedMaterialsByWorkingUnit"
In this query, add 1 parameter: Parameter WorkingUnitID of type Integer.
Go to the Write Code dropdown and select "UnusedMaterialsByWorkingUnit_PreprocessQuery"
Make your PreprocessQuery look like this:
partial void UnusedMaterialsByWorkingUnit_PreprocessQuery(int? WorkingUnitID, ref IQueryable<Material> query)
{
query = from material in query
where !material.MaterialWorkingUnitMaps.Any(c => c.WorkingUnit.Id == WorkingUnitID)
select material;
}
Go to your LIghtswitch screen where you have your dropdown.
Add Data Item... and select the UnusedMaterialsByWorkingUnit query.
On the left of the screen, click on the WorkingUnitID which is in the query and databind it to WorkingUnit.ID that is loaded on the screen.
Go to your dropdown and select the UnusedMaterialsByWorkingUnit collection as the source.
Let me know if this works!
In the command that adds a selected material item to the MaterialWorkingUnitMap, add some code that removes the selected record from the Material collection. With Lightswitch's databinding, that should immediately visibly remove the Material record from the view. However, when you call SaveChanges, this will cause a deletion of those material records from the database, which I don't imagine you want to do. So to prevent that, in the SaveChanges pipeline, you can call DiscardChanges on the deleted Material records.
This is my first time building a UI in Access (using Access 2007), and I'm wondering what is the Right Way (TM) of going about this.
Essentially, I have several different queries that I'd like to display as pivot charts, pivot tables, tables, and reports. Eventually I'm also going to have to build forms to manipulate the data as well, but the application's primary function is to display data.
I'm thinking of having a button for each different display down the left side of the main window, and having the rest of the window display each button's corresponding contents (e.g. a pivot chart).
I have an idea that this can be accomplished using a single subform in the main form, and setting the subform's Source Object property within a function such as this one:
Public Function SetSubformSourceObject(newSourceObject) As Variant
subform.SourceObject = newSourceObject
End Function
Then, for each button I'd set its OnClick property to call this function with the name of the query I'd like to run.
Now, I have no idea if this is the best way of going about things, and would really appreciate some input :)
The principle seems fair to me. You have to give it a try. You do not even need a form-subform structure. You can set your sourceObject at the form level, and have your buttons in a commandBar instead of having them as controls on the form, so you do not have any 'form specific' code (like "onCLick") and controls. action/command controls on a form are space, code and maintenance consuming, while commandbars are more generic and are THE object that can hold all your action controls.
I have some data Grid Views and I want the user to be able to keep changes he does to them. Not the Data changes, only the layout changes, like the width, the hight, the order of the columns and maybe the visibility of them. I don't care if it will be automatic or by clicking a button...
Edit: I found a way to do this using Settings.I have added the settings file, but I have no idea of how I'm supposed to add column order or column size in those settings
The kind of formatting information you want to save can be found in the various properties of the DataGridGiew. You may have to spend some quality time with its object model documentation, but you should be able to find most of what you're looking for.
For example, to save the way the rows have been sorted, you can persist these two properties:
DataGridView.SortedColumn tells you on which column's values the rows were sorted.
DataGridView.SortOrder tells you the order (i.e. ascending or descending)
And you should be able to find info about column widths and order on the members of the DataGridView.Columns collection.
I think it's a matter of preference whether you record these values all at once (e.g. click a "save settings" button) or one by one in event handlers as the properties get changed. I like to save them automatically when the form is closed w/out any action by the user. It's been a while since I implemented anything like this, but I recall the app settings being a pretty handy place to keep this sort of info. In the Project Properties Settings designer, just define settings for the stuff you want to keep (make sure to set the Scope to "user"). Then assign and load actual values in your code at run-time, like so:
// e.g. you defined an integer user setting at design time called ColA_Width, to
// hold the value of the width of "ColA" in your DataGridView.
// Use this code to save the value (either in a specific event handler, or a
// global "save settings" routine).
Properties.Settings.Default.ColA_Width = MyDataGridViewInstance.Columns["ColA"].Width;
Properties.SEttings.Default.Save();
// Then you'd reverse the assignments when the app next loads so that the saved
// settings are "remembered" between user sessions.
MyDataGridViewInstance.Columns["ColA"].Width = Properties.Settings.Default.ColA_Width;
The only caveats I can recall are that some of the DataGridView property values are not straightforward to save as strings (remember that your user settings are ultimately saved as XML), but it really depends on what sort of settings you're saving.
I am assuming you mean the end user, if so then I would store that info in cookie/database and pull it on load to customize their experience.
In each of your event handlers for resizing/sorting you could have a helper function that writes the layout instructions to a storage medium like a db, registry, xml, config, etc... and read those instructions to draw the interface when the application loads.