Limit table in spotfire based on marked rows in another table - filtering

I have 2 tables in my visualization. One is a list of tasks to be done, and one is a list of repairs that have been done at each location. I want to be able to filter the repairs table by the locations of the highlighted tasks. Ergo if you marked a task that takes place at location 1, the second table would filter to only show repairs for location 1. Is that something that's doable?
Thanks in advance

This is pretty easy to do. You need to create a relation on the Location column between your two tables (Data table properties, Relations tab). Then create a details visualization (right click on "parent" table and select details visualization). Because you have created the relation already, it will ask you which table you want to be the "child". After selecting which table, you will be able to click on the parent, and it will filter in the child table. Also note, using the right click menu is engaging the data limiting with marking, which you will be able to see in the properties dialog, data menu. You don't have to use the right click menu to setup details visualizations. It's just easy.
I've written a lot about how to use relations and column matches. See links below. Relations integrate filtering, which is what you want. Column matches integrate marking.
https://www.bigmountainanalytics.com/apply-relations-and-column-matches-in-spotfire/
https://www.bigmountainanalytics.com/how-to-use-relations-in-spotfire/
https://www.bigmountainanalytics.com/how-to-use-column-matches-in-spotfire/

Related

Loop through database ANYLOGIC

In my model I want to loop through the database which contains multiple columns (see example) by an event. The idea behind it is that I want to create dynamic events based on the rows in the database.
But I've no clue how to iterate through a database in anylogic and also was not able to find an example of a loop with a database.
The dummycode of my problem would look something like this:
For order in orderdatabase:
Create order based on (order.name, order.quantity, order.arrivaltime, order.deliverylocation)
Where order in the loop is every row of the database, and the value on which the creation is based based on the different column values of that specific row.
Can somebody give me a simple example of how to create such a loop for this specific problem.
Thanks in advance.
Use the database query wizard:
put your cursor into a code field
this will allow you to open the database wizard
select what you need (in your case, you want the "iterate over returned rows and do something" option
Click ok
adjust the dummy code to make it do what you want
For details and examples, check the example models and the AnyLogic help, explaining all options in detail.

How to get the different ID's of loading docks

I would like to create a database to load my trucks at a certain time and on a certain dock. So for example truck A should load on dock 1 at 6 am. The problem is that I don't know how to get the different IDs of my docks. I create a parameter called id but don't know which ID my different docks have which I write into my database.
Database
]1
agent/population_dock
Create a new dbase table "docks" with an int-column "dock_id". Fill it with as many docks as you want to create and give them an id number.
In your existing table, link the "id" column to that new table "dock_id".
When you create "Dock" agents in your population "loadDocks", you can select "loaded from database". Create 1 agent for each record in table "docks" and map the "dock_id" column to your parameter "Dock.id".
Now each dock knows its id.
Lots of AnyLogic example models use this setup, so check these out as well (search for "database"). And read around in the help, this is documented very well :)

Filemaker conditional dropdown population

continuing a project I have posted a few questions for already are you able to have a more precise definition of what a dropdown is populated with?
I am using FM Starting Point and have a Projects, Estimate and Task table. A project can hold multiple estimates and tasks. Estimates contain multiple lines (stored in a separate table).
When In a Project you can add a task for that project. What I want to do is replace the field that gives the task a name with a list of lines contained within the estimates related to the project i have selected to add the task from.
I have created a dropdown and using the inspector got it to display all estimate lines but somehow I need to write a function that will only select lines from estimates that are within the project and also only estimates that have a field set to "active" for example.
what I am struggling with is where I can programme such a thing? In the inspector, you are limited to displaying a value and cant programme in a statement. I have tried a script that executes OnObjectEnter or OnObjectModify but that doesn't appear to work.
Any ideas where I can enter a more complex set of rules as to what populates a dropdown?
Create a relationship with the criteria you need. Base the value list for the dropdown on this relationship.
As for display, The value list's second field can be from a calculated field with any data or several other fields stringed together if no single field is sufficient. The first field should be the ID.

Row selection for QLIK Sense table

I have trouble ticket data, with a status field (either Open or Closed).
I'd like to make a sheet that shows graphs (and a table) for data associated with "open" rows - and I don't want a filter to do the subsetting. Graphs on this sheet only make sense for "Open" tickets.
I can do bar charts (I think) with set selection logic.
But I'd also like a table of open tickets, sorted by age.
How can I specify that my table only have rows where status == "Open"?
One way would be to use a calculated dimension.
While editing, create a new Dimension under master items. Then, add an expression like:
If([Status]='Open',[TicketId])
and using it in a table would give you a table with the TicketIds corresponding to Open tickets.
Reference information can be found on the Qlik Sense help site:
http://help.qlik.com/en-US/sense/2.2/Subsystems/Hub/Content/Dimensions/calculated-dimensions.htm
http://help.qlik.com/en-US/sense/2.2/Subsystems/Hub/Content/Dimensions/create-calculated-dimension.htm
Please read the notes on performance, and see whether this solution suits your application.

Adding a 'Heading 1' to a Word 2010/13 Doc in Alphabetical Order

I'm operating in Word 2013 and 2010, so I can use code that works in either. I'm trying to create a word document to keep track of my recipes. At its most basic I want to have a TOC that updates based on headings. I also want it to have any category I want (eg: Appetizers, Drinks, Entrée, etc...) ordered alphabetically. Under each category I have tables. Each recipe gets a table that has it's name, directions, notes, tags, and potentially a picture. The second cell has another two column table inside of it that contains the quantity and name of each ingredient necessary for the recipe.
I have all of that so far and I'd like to automate adding new categories and recipes. Currently, I have to find the category, then scroll down to find where the name goes alphabetically and insert a quick table I made. I then fill in the info.
I'd like to be able to search the document for each category name, then insert the new category wherever it belongs, with a space before and after it. I found that my tables give me trouble if I don't have a space between everything. It tries to pull anything it's touching into the table and merge them.
I wanted to give the backstory, so you'd know where I was going to go eventually and could provide help that fits better with what I need. After I can add a new category, I plan to use vba to organize each table alphabetically by the name in the first cell of each table. It will also help when I start adding sorts to it. Eventually, I'd like to be able to sort it to say, only display recipes from a certain person, or display my frequently used recipes. I'd then have it either hide all the others or create a new doc with just these. So thanks for the help. Below I'll post the code I most recently tried. I tried a few other variations of this same code and keep getting an 'expected end of statement. I've gotten other errors when trying other variations of it, but this is the best I can come up with on my own.
Private Sub UserForm_Initialize()
For Each cat In ActiveDocument.Styles = "Heading 1"
lstCat.AddItem (cat)
Next
End Sub
I have a form called frmAddCategory I'm using as a test. I was going to have a listbox lstCat to show every category with the style heading 1. I have a textbox called txtAdd to type new ones and a cmdAdd button to add it to the form.
Edit: I've been playing around with my macro recorder after finding out about outline view mode. I set it to show only 'heading 1' level and selected the ones I wanted, not selecting the appendix or reference. Then I went to the home tab and sorted paragraph by ascending alphabetical order. I got some code I believe I can use to get it to run in VBA. However, it's not a complete fix as I don't want to select the last two with heading 1. It also works if I manually select the tables under each heading 1, but I can't set the spacing before and after. I'd like each heading and the tables under them to have a space or two between each for looks and editing purposes.
Also, if someone is going to give my question a negative rating, then please post a comment explaining. As far as I can tell from the faq about the forum and the other questions I've seen, it is a well posed question. A clear title, a good explanation of the problem, code examples, research. So if I am doing something wrong, please inform me, so that I can correct it.
first thanks for your bit about macro recorder and outline mode, I have been trying for long time to fill a list box with selection.text between two HeadingLevel(1) headings.
now to yours, sorry I can't think of way to do in word. BUT it would be real easy in Access. one table of categories like called tblCategories another for recipes tblRecipes. To make real easy, when the use autoID on ALL tables. But to avoid LOTS of headaches for tblRecipes rename its autoID to RecipesID same for other tables. in table of recipes you can use a memo field to hold large amount of data. the spot for text in Heading would be put in one field of the tblRecipes. once you have tables looking to have a field for each item you want to track. hit save, then use wizard to create a form based on table. repeat for all tables you want to have it real easy to put info into any table.
1.reportTOC based on query of Every Heading you want, can preview or print as want. reportByCategory and so on reports are sorted a to z unless you want to sort by Owner, then recipe all auto sorted a - z.
report wizard to get hard copy. if you want to sort real easy, built in. also if want to be able to pick all recipes for a holiday real easy, one table tblHolidays. one tblHolidayRecipes fields autoId (not used by you anywhere but needed), fldRecipesId (holds RecipesId) , fldHolidayId (holds HolidayId). the wizard will show how to get only what you want. in access 2013 you can include pix of food or.