Tableau calculated field - How do I select narrow down selections from tables? - tableau-desktop

I am working on narrowing down the selection from three tables. The hierarchy looks like the link below.
PublisherAccountID includes a list of PublisherName, and within Publisher name, it contains a list of Imprint.
PublisherAccountID > PublisherName > Publisher Imprint
I am creating narrowing options for each hierarchy on Tableau.
For example, if I have two PublisherAccountID, A and B, A contains 1,2,3 while B contains 4,5,6. If I select A, then the option for PublisherName will now show 456.
Sorry I don't know how to not embed pciture link. The heiracy is below
enter image description here

Have you grouped the fields? You can always create a group. You can name the group from the 2nd level i.e. B, and group the relevant items (4,5,6). You can then use the new Group field as a filter.

Related

How can I find the first instance (searching up) of a value in a column?

Picture linked below as this is a bit tangled:
I am working with a data set that has "nested" values. There are three different types of entries: categories, then subcategories that are nested under the categories, then individual items that are nested under the subcategories (picture linked below). The entries are matched up using a filter system. Column A has the entry type, column B has the actual value, column C has the filter. The filter is always the value of entry you are nesting under. So, for a subcategory entry, Column A= "Subcategory", Column B= [name of subcategory] Column C = Column B of the category type entry above (the name of category it belongs to).
I need a way to automatically fill in the filters.
The way I am thinking I could do this is to search Column A (moving up) for the first instance of the entry type I need, and then return the value of the Column B cell in that row. Is this possible?
Given your exact data above (looking only at A14:C), delete everything from C14:C (including the header) and place the following formula in C14:
=ArrayFormula({"FILTER"; IF((A15:A="") + (A15:A="Category"),, IF(A15:A="Subcategory", VLOOKUP(ROW(A15:A), FILTER({ROW(A15:A), B15:B}, A15:A="Category"), 2, TRUE), VLOOKUP(ROW(A15:A), FILTER({ROW(A15:A), B15:B}, A15:A="Subcategory"), 2, TRUE)))})
This will create the title (which you can edit within the formula itself as you like) and all results for non-null rows thereafter.
You'll need to adjust the 15 in ranges to whatever the starting row of your non-header data actually is in your sheet.

Delphi, Master-Detail with DetailFields in the where condition (not in select-part)

I am using master-detail connection to show a list of assigned columns of a detail-table. In addition i want to show a second grid with not assigned detail columns
Example
Master-Table t_human: idHU, nameHU (like John, Oscar, ...)
Detail-Table t_property: idPO, namePO (like male, female, blond hair, beard, blue eyes ...)
Join-Table t_hu_po: idHU, idPO
-> John - male, blond hair
-> Oscar - male, blue eyes, beard
When i select a master table row i want to show the assigned porperties and also the not assigned ones. The master-detail for the assigned properties works fine.
But for the not-assigned properties doesn't work.
Detail-SQL:
select p.idPO, p.namePO
from t_property p
where not exists (select * from t_hu_po hp where hp.idHU = :idHU and hp.idPO = p.idPO)
Master-SQL:
select idHU, nameHU from human
When i try to select the detailfield in the delphi component (Devart, SDAC, TMSQuery) it only shows me the fields for p.idPO and p.namePO. The :idHU parameter in the statement is configured as parameter for the query in the component. When i manually type the idHU in the DetailFields property of the Dataset (TMSQuery) i get an Invalid column name 'idHU'.. from delphi when activating the query.
Does someone knows a better solution than doing it with events for datachange and manually setting the detail-parameter and refreshing the detail-query.
My thought was, that master-detail would do the same thing but only in background, so that i don't have do code it.
Thanks
Stephan
Instead of using the where not exists try where p.idPO not in (Select idPO from t_hu_po where idHU=:idHu)
By makinge the subquery simply return all the idPOs that exist for the selected idHu, your query now looks for the properties that are not in that list.

SSRS: Adding a filter that returns information from entire group

I am trying to create a report in SSRS. Below is a small example of what my dataset looks like.
Example Data Set
So, there are three different stores (A,B,C) and each has a landlord (a,b,c). Landlords can pay via three different methods (1,2,3) and the amounts paid per method are shown.
Right now, I have two filters set up. The first is by Store and the second is by Landlord.
What I am having trouble with is:
How can I set up a filter by the Amount that will return information from an entire Store/Landlord?
So for example, if I wanted to filter Amount by 150, I would like to return all the "payment" information for the store(s) that have a payment of 150. Such as the following:
Desired Result
Is it possible to add a filter to return information from the entire group? (Store and Landlord are the group in this case)
I am new to SSRS so any help/insight would be greatly appreciated!
You can use LookUpSet to locate the matching groups, JOIN to put the results in a string and the INSTR function to filter your results.
=IIF(ISNOTHING(Parameters!AMOUNT.Value) OR INSTR(
Join(LOOKUPSET(Fields!Amount.Value, Fields!Amount.Value, Fields!Store.Value, "DataSet1"), ", ") ,
Fields!Store.Value
) > 0, 1, 0)
This translates to:
If the Store value is found (INSTR > 0) in the list (JOIN) of Stores where the Amount is the current Amount (Lookupset).
In your filter, put the above expression in the Expression, change the type to INTEGER and the Value to 1.
[

Is there a way to make this type of query work?

=query(G2:I80,"select G,H,I where H=max(H) group by I",-1)
Columnn G is names
Column H is vote count and
Column I is Their respective teams.
I want to view the top voted names of each team and sometimes the some top voted names are tied so I wanna view both names using the query above but it dont seem to work.
I am not entirely sure what you want (a formula that does not work is not a good guide) but perhaps:
=sort(filter(query(G2:I80,"select G, H, I ",-1),H2:H80=Max(H:H)),3,TRUE)

cxGrid boolean type group summary item

I have a field (OK) in my cxGrid which is displayed as a checkbox (properties : checkbox). It is an actual database field (boolean) in my SQLite database . Can I group this field so that the grid displays how many items are checked and how many are not (default for groups) ? Right now I managed only to count the items.
The display I have now is something like this :
I need to count checked and unchecked items. Is this possible at all?
EDIT :
In one similar program I have such a feature implemented below) :
Here the sum works since it sums up numbers. In this case I dont know how to sum up
true/false thing... The best next thing I came up in this example is this :
Just changed the field name from 'ok' to' urejeno' ....

Resources