I need to select all the recipes (in this case) that have these specific ingredients - select

Im trying to select all the recipes that have chocolate and water only, currently the ingredients table has all the ingredients that the recipes have, but when i try to select , it only will select in a specific order, for example if i instead of putting chocolate first and water second, decide to put water first and chocolate second it will not select anything. Im using pgadmin4.
select nombre, ingredientes from recetas where Lower(ingredientes) like Lower('%chocolate% %agua%');
(here it shows one recipe)
select nombre, ingredientes from recetas where Lower(ingredientes) like Lower('%agua% %chocolate%');
(while here it shows none)
Basically i need it to seatch without the order priority

Related

In tableau how to show unmatched row in my case?

I'm new to tableau.
I have a data like this.
[department]
[employee]
And I want to get employee count under 30 age per department. like this..
[my goal]
I want to show all departments (if there is no employee)
To get result, I do these steps,
make relationship of dept - emp (one datasource)
make datasource filter (emp.age < 30)
make sheet and set row as dept_no, countd(emp_no)
But I could only get like this.
[my result]
How can I get my goal..!!??
Help me!!
It is simple hereafter. Use join (instead of relationship) on the side of dept table and Take dept_no column from dept_table instead of emp_table. To do this follow these steps
double click on first added table (say emp). A join window will open (thgis differs from relationship)
add dept table and use right join
right click age convert to dimension
right click again age and convert to continuous
create filter at most 29 on age and don't forget to check include null values in the table
If you want to add all values in view. create a calc field with calculation as
INT([Age] <30)
add sum of this field to view
edit the calculation to show all nulls as 0
ZN(INT([Age] <30))

Tableau Count distinct of count distinct

I have below data
Name Product
XYZ A
XYZ B
XYZ A
MAP Z
MAP Z
I want only those customers that have more than 2 distinct products. So in the above example, we get only XYZ, so the count is 1.
Not sure how to do it.
Thanks,
Hema
If you only want to see the customers without information on the different products, you can drag the Name pill to rows, create a calculated field distinct_products as
COUNTD([Product])
and drag it to filter. Select 'at least' and enter '2'.
If you still want to see the product information you can solve this using Level of Detail expressions in Tableau together with a filter.
Create a new calculated field distinct_products as follows:
{exclude [Product]: COUNTD([Product])}
Drag this to filters and choose attribute. Then select 'At Least' and enter '2' as value. Now the filter is in place. What you then need is to drag the 'Name' pill to rows.
If you want the products to be shown in a single row: drag the Product pill to 'Text'. If you want the products to appear in multiple rows, drag it to rows.

Top 10 and items upon user's demand

fellow Tableau Developer,
Take the super store database for example, it is easy to draw a histogram displaying the sales amount of each customer and to only display the Top 10 customers.
It is also easy to build a multiple dropdown filter to let the user to specify some customers at the user's will.
But, is it possible to combine the two of them, namely, to display Top 10 customers and in the same graph display a few other customers (possibly not in the Top 10) on the user's demand?
Here is a straight forward solution that works with Tableau Desktop, but not as useful currently on Tableau Server. The viz still works on Server, but you can can't alter the list of specific users on Server.
Here's the approach.
Create a set to represent your Top 10 customers -- a computed set. (right click on the [Customer Name] field, and Create Set)
Create a second set to represent your specific list of customers of interest -- a static set (select [Customer Name] and Create Set)
Create a combined set to be the union of both sets and place it on the filter shelf. (select both sets, right click and create a combined set)
Use your combined set on the filter shelf, row shelf, in calculations, as desired.
A desktop user can edit the Interesting Customers set. Sure wish there was a control similar to "show filter" for editing set members.
If you'd like this feature more flexible in Desktop, and even available on Tableau Server, upvote the following idea
https://community.tableau.com/ideas/5193

Grouping Rows ("conditional copy") from different tables in LibreOffice Calc

I want to group the students of some classes into different groups at school using LibreOffice Calc.
I already have tables for all classes, where I entered the group (1-3) of every student:
What I LibreOffice want to do now, is to copy all students of all classes, which are in group 1 (group 2, group 3, ...), into one new table (Group1). Then, I have one list with the students for every group.
In this example, it would be Name1 and Name6.
I searched the web for hours and played around a lot without success.
Any help is appreciated!!
Select the data cells A1:B8;
Menu Data -> Standard Filter...
In the standard filter window, set the filter properties as follows:
Field Name: Group; Condition: =, Value: 1 (or select from dropdown);
Click on Options
Select "Copy results to"; enter the target: $Group1.$A$1
Click OK

Grouping formula to account for two fields

Working with vehicle asset management and I am selecting data based on two statements:
({EQ_MAIN.PROCST_PROC_STATUS} in ["A", "AS", "AT"] and
{EQ_MAIN.DEPT_DEPT_CODE} like "P*" and
{EQ_MAIN.ASSET_TYPE} <> "COMPONENT")
or
({EQ_MAIN.PROCST_PROC_STATUS} in ["TA"] and
{EQ_MAIN.DEPT_TEMP_LOANED_TO} like "P*" and
{EQ_MAIN.ASSET_TYPE} <> "COMPONENT")
Basically, if the Equipment is in status A, AS, or AT and belongs to the departments that start with P, I want it to show on the report. However, the second part of the selection statement accounts for equipment that is temporarily loaned to another department (status TA). The selection statements seem to be working fine.
I have this data grouped by {EQ_MAIN.DEPT_DEPT_CODE}. But I want it to to include any temporarily loaned out equipment under the department group, if the equipment is on temp loan to said department. For example, Car A belongs to department K1234, but is on loan to department P5678. I want Car A to show up under the group for P5678 along with all the other vehicles that belong to P5678. Essentially, whether a piece of eq belongs to a specific department or is simply on loan to said specific department, I want to see them under the same group in Crystal. Thoughts?
I do not believe that a grouping formula is the solution for this scenario. The challenge is based in the recordset. Since there is only one LOANED_TO record per DEPT_CODE, you can go about this a couple of ways.
If this is an option, modify your query or view so that you generate all LOANED_TO records for each DEPT_CODE. This could be achieved by placing a subquery in your FROM clause if using SQL. Then, join your parent table EQ_MAIN to the subquery on a non-unique, general key. Since there is no one-to-one relationship in this scenario, you should get all LOANED_TO records for each DEPT_CODE. This will, however, bloat your recordset and mar performance.
Then, group the report first on {DEPT_CODE} and second on {LOANED_TO}. Use a suppression formula on the second group to hide any {LOANED_TO} Departments that do not match the parent group {DEPT_CODE}.
The more "traditional" Crystal approach is to group on {DEPT_CODE}. Then, add a sub report to a group section. Using the same datasource, move the second chunk of selection criteria (following the OR clause) to the sub report record selection. This will return all {LOANED_TO} records. Add a sub report link between the group {DEPT_CODE} and the sub report {LOANED_TO} dept. This will filter results to just those {LOANED_TO} records related to the main group.