Qlikview: Automatically select default value in listbox when selecting value in other listbox - listbox

My question is kind of a complicated one to explain.
I have two listboxes; ShopId and PosId. a ShopId is unique, but a PosId isn't. Example population:
ShopId | PosId
1 | 1
1 | 2
2 | 1
3 | 1
There always has to be one and only one value selected in both listboxes ( PosId and ShopId).
My problem now is that when i select ShopId=1 and PosId=2, i can't click on ShopId=3 because ShopId3 doesn't have a PosId2.
I basically want to change my PosId to the lowest possible value when i select another shop (So that there will always be a selected value in both lisboxes).
If something is still unclear, please ask.

You can create PosId list box with below config:
New List Box / Field / < Expression >
In expression box, enter as:
=MIN(PosId)
Then when you select the ShopId, value in this box will always show the minimum possible.

One way of achieving this is using a trigger on the sheet.
Event will be change in selection on the field (in your example ShopId).
Action will be default selection on a field (in your example PosId)
Note:
You will have to set the value of selection in Action Field such that it is universally present in all relational instances of ShopId.
Alternatively, you can make the selection value a calculated one using set analysis.
Hope this helps.

Related

In Tableau how do I use RANK to calculate an "OTHER" field?

I'm new to Tableau so this may be an easy question about computations using RANK. I can't find any tableau HELP or other stack-overflow answer to this. Maybe this is a GROUP question. Maybe it's about OTHER.
I have a data set of 160 countries ( rows ) with a field for jetfuel consumption for each country.
I just want to make a bar chart like the attached image showing the 20 highest fuel-consumption countries by name ranked by jetfuel_consumption ( I can do that much) AND an 21st row computed country name titled "Rest of world" summing the remaining 140 countries together as if it were just another country like the bottom of this model .
I have a working valid computed field labelled "myrank" = RANK(AVG([Jetfuel Consumption]),'desc')
My thought was to simply calculate a new text field that would equal the country name for rank < 21 and then be the string "Rest of World" otherwise.
Such as:
IF ( [therank] < 11 ) [Country] ELSE "Rest of World" END
But that is not valid for an unspecified reason. I know I'm confused already about how to just specify the value of a field without something like SUM or AVG or AGG wrapping it, but this is a larger question.
What's the right way to make this view?
I've created simple dataset:
And I want to group TOP 3 countries by Consumption.
To do it I should create a set (click on Country in Dimension) and select TOP 3 By SUM(Cosumption):
Then create a calculated field to show Countries IN Set and "Others".
IF [Country Set] is a boolean expression "The country IN a set".
Drag and Drop corresponding fields and configure sort, for example:
Sets are convenient to dynamically change, expand and customize any visualization. More detailed: https://help.tableau.com/current/pro/desktop/en-us/sortgroup_sets_topn.htm

Google sheets - select multiple columns for data validation

I'm new on google spreadsheets, and I'm having this little problem:
I want to create a project manager with an external spreadsheet just for customer-info. In my "main-hub" sheet, I have created a dropdown menu on B11 which copys the customer names from the extrenal sheet. That works fine.
Now the problem I am trying to solve: I want to keep the drop-down menu on B11, i dont want to add any new drop down menus. Whenever I select an item from the menu on B11, additional information about the customer should be inserted into different cells in different columns. Example:
| __________ B11 __________ | __________ J11 __________ | __________ K11 __________ |
Selected Name dynamicly inserted data 1 dynamicly inserted data 2
Please keep in mind, I really don't want to add any new drop down menu, I want to keep only this one for the names of the customers.
What you're looking for is "VLOOKUP". This is a Formula where you can define a specific range and select the part you want to display. I've edited your spreadsheet.
=IFERROR(VLOOKUP(A2;'Customers static'!$A$2:$C$5;2;FALSE);"")
IFERROR Value, [value if error]
VLOOKUP Search key, area, index, is sorted
Seeing that you have not solved your answer. I have created a new sheet in your spreadsheet showing you a possible answer.
Possible solution
Basically you can have a dynamically expandable sheet with the use of ARRAYFORMULA.
Which is kind of basically repeat this operation for the whole range. In this case you just would need to put one formula for each column:
=ARRAYFORMULA(IFERROR(VLOOKUP(A:A;'Customers static'!A2:D;2;FALSE)))
Look how instead of using a single value for VLOOKUP you are using the whole range and ARRAYFORMULA will handle that. Therefore you just need to write the formula at the top of each column, changing the index for every single column in the original data.
You can take a look in the Raserhin's help on the sheet you have provided.

Checkbox (or SOMETHING) to activate a row in Google Sheets

My wife runs a dance school, and occasionally needs to calculate the average age on a given date of a group of dancers. I'm not having a problem with the age calculation and averaging, but I wish to add a feature:
My sheet has all dancers in her company listed. Currently, we copy them all, paste to another sheet, and then delete the ones not included. That's a PITA, so instead I'd like to be able to put a checkbox in the first column, that when checked, would INCLUDE the associated age column in the calculation. So, she could just go down the list, click the included dancers, and it would calculate the average JUST for the selected ones and ignore everybody else.
Honestly, at this point, I have ZERO idea of where to start to do this and need a gentle push in the correct direction. Assume I'm an idiot and know almost nothing.
Here's an example sheet with the new checkbox feature to illustrate the function:
https://docs.google.com/spreadsheets/d/1G8LJyS10yi1HIa2MNHCbWUJPso9QAit3i0cO8A-Uw3A/edit?usp=sharing
I placed the formula above the "Age" column (Column C), and the Checkboxes in Column A:
=iferror(AVERAGEIF(A3:A,TRUE,C3:C),"NO DANCER'S SELECTED!")
This also displays an error message in case no dancer's are selected.
Try this. It looks for 'y' in column A. Assumes names are in column B and ages in column C. You can adjust the columns to match you sheet, and change the 'y' to whatever value you want to enter. It will average the ages of the rows with 'y' in column A:
=AVERAGEIF(A2:A,"=y",C2:C)

Drop-down list based on value on another cell in another sheet

I have searched for this question and found some useful tips but I can't seem to figure out the answers that they provide, so here's the scenario:
Top image: Sheet Name is Animals
Bottom Image: Sheet Name is Health
So the sheet Animals Column A (Owner) contains the data for dropdown list in sheet Health Column A (Owner).
What I want is in sheet Health if I choose CoopB (on dropdownlist Based on sheet Animals) I want the Column B (ETN) row 2 to become dropdownlist and the choices is based on the value of CoopB in sheet Animals.
Example: On sheet Health
| Column A (Owner) | ColumnB(ETN) |
|------------------|--------------|
| CoopB | CW-011110 |
| CoopC | CC-111101 |
| Coop1 | Coop1-0001 |
Note: on Sheet Animals Column C (Owner) value can be repeated, for example, we can expect CoopB value to appear repeatedly but on Column D (ETN) data are unique.
You can work similarly here, this time a Control sheet seems like a little less overkill.
Let's create a sheet called Control
In Control!A1 put "Owner"
In Control!A2 put =UNIQUE(Animals!C2:C)
In the data validation of Health!A2:A put the range Animals!A2:A
Now you can select the unique pet owners.
For a single Owner
For a single owner (in Health!A2) you could
In Control!B1 put "ETN"
In Control!B2 put FILTER(Animals!D2:D, Animals!C2:C = Health!A2)
For multiple Owners
For multiple owners we need to use the control sheet some more
In Control!B2 put =Health!A2:A so we have a mirror of our selections in Health
In Control!C2 put =IFERROR(TRANSPOSE(FILTER(Animals!D2:D, Animals!C2:C = B2)), "").
Drag the formula down however far you think you may need it (I could not get this to work with an Array formula)
Set the data validation in Animals!B2 to Control!C2:Z2, in Animals!B3 to Control!C3:Z3 etc.
You have to do this manually unless you want to write a script that fills in the data validation rules for you

TableSorter filer functionality

I am wondering if I can have "!Peter" option while filering on the first column of the first table example here?
I should be able to have all other options + !Peter ?
Thanks in advance,
Aparna
The demo you linked would not allow you to enter and search for !Peter because:
The first column (with "Peter" in it) is set up to use a select element.
You could enter !Peter in the second column, but it would not return any results because that column is set up to only return exact matches.
I set up this demo without either of those restrictions, and if you enter !Peter into either of the first two columns, the expected results will show.
Now, if you mean you want to change the select element options, then you should look at the documentation for the filter_selectSource option.

Resources