How to filter my view of Groups to show results matching Term A or Term B

By default, all Filters get added to the same Filter Group (a filter group is just a group of filters that share a logical operator, e.g. AND or OR). The default behavior is to put all filters into the same group with the logical operator AND. This means that if you have Filter A, Filter B, and Filter C, the view will only produce results that have the value from each filter, Filter A, Filter B and Filter C.

You can review your filter operators and grouping by clicking the Dropdown Button for Filter Criteria and choosing the And/Or Rearrange option.

Views Filter Criteria And/Or Rearrange screen showing Filter A, Filter B, and Filter C in one filter group with logical operator AND

However, it sounds like you want Filter B and Filter C to use an OR Filter group, i.e. you want the view to show results where the content has the value from Filter B or has the value from Filter C.

To do this, you need to make sure that Filter B and Filter C are in their own Filter group and that group’s logical operator is set to OR. If you only have the two filters, you can use the original grouping, but change the operator. However, if you have other filters, e.g. my example with 3 filters, you’ll need to create a new group.

After you create a second filter group, you’ll see that you can control the operator for each filter group and you can also control the operator between the filter groups.

In an example with Filters A, B, and C, if I want to display all results where content has the value from Filter A AND the content has the value from Filter B OR Filter C, I would create two filter groups:

  1. Group 1: with only Filter A
  2. Group 2: with Filter B and Filter C

I would then set the logical operators:

  • Group 1’s logical operator would be set to AND (the default, there’s only one filter here so it shouldn’t matter).
  • Group 2’s logical operator would be set to OR (as we want to get results where the content matches either of the Filter B or Filter C, it does not need to match both).
  • The operator between Group 1 and Group 2 would be set to AND

Views Filter Criteria And/Or Rearrange screen showing Filter A in one Filter Group with logical operator AND, Filter B and Filter C in a second filter group with logical operator OR, with the AND operator between the two groups

field of view – What is the focal length on your typical cell phone camera?

Focal length does not change with sensor sizes – what actually changes is the field of view:

FOV (°) = 2 * arctan ( d (mm) / (2 * f (mm)) )

FOV is our field of view in degrees, d is one of the dimensions of the sensor (for diagonal, it is d = √(h² + w²) ) and f is the focal length in millimeters.

In very simple terms, a smaller sensors sees a smaller portion of the lens’s projection – e.g. a APS-C sensor does not fill out a 35mm lens’s image circle, so it cannot see the outer portions (which relate to the outer regions of the frame) and therefore, the field of view is narrower than it would be with a full frame camera.

When we talk about crop-factors, what we really are talking about is the change in field of view by a smaller sensor: The reference is a full frame sensor, which is 36*24mm. Therefore, a 10mm lens on an APS-C camera is still a 10mm lens – it just happens that it offers the same FOV as a 15mm lens would on a full frame camera.

The same of course is true for smartphones – unfortunately, the smartphone market is constantly and rapidly changing, and manufacturers usually do not state focal length or sensor size in their marketing texts, so research is needed on a per-phone-basis (or so I think).

A (at this moment) recent iPhone X offers an equivalent-to-28mm lens and an equivalent-to-52mm lens, the Samsung Galaxy S9+ offers 26/52mm, the OnePlus 6 offers 25mm, the Huawei P20 offers 27mm/80mm, the Nokia 6.1 offers 27mm,…

So it seems we can conclude that 26-28mm (equivalent) are a standard in Q3/2018.

What’s the best encryption strategy to go with when everybody needs to be able to write data but only a select people can view it?

I really just need an encrypted support ticket system essentially. The user who writes the ticket doesn’t need to be able to view it afterward but a handful of staff need to be able to decrypt the data and view it. My backend is Firebase (using Firebase Authentication as well) and the users will be submitting information via the mobile app and the staff will be viewing the information on a web app. Ideally, the encryption/decryption would be done on the client-side.

materialized view – What is the correct way to do a computed column with complex logic with performant sorting and filtering at scale in MS SQL Server?

I have the Quantity indexed on both tables because I obviously wish
to sort and filter on this column, but of course the index doesn’t
help if I want to sort and filter on vwThingAugmented.

Based on your view and the comment on filtering I am going to assume queries like this:

FROM  dbo.vwThingAugmented
WHERE Quantity = 5;

Where there is a filter operator late in the execution plan:

enter image description here

One of the things you could try, depending on the size of the tables and the type of filters you do would be to create a view with a UNION an INNER JOIN and a NOT EXISTS instead of a LEFT JOIN

CREATE VIEW dbo.vwThingAugmented_2
, Quantity = t.Quantity + a.Quantity
, AdditionGroupID
FROM dbo.Thing t
INNER JOIN dbo.AdditionGroup a ON  t.AdditionGroupID = a.ID
, Quantity = t.Quantity
, AdditionGroupID
FROM dbo.Thing t
WHERE NOT EXISTS (SELECT * FROM dbo.AdditionGroup a WHERE  t.AdditionGroupID = a.ID);

You do get two accesses to dbo.Thing and dbo.AdditionGroup in this case, YMMV depending on the type of query you run against the view. You could try running the same query again:

FROM dbo.vwThingAugmented_2
WHERE Quantity = 5;

This removes the filter operator but you do have double index access with a concatenate.
enter image description here

And you still have residual predicates on both parts of the query,

Because the nonclustered index is not covering:

DROP INDEX IX_Thing_Quantity ON dbo.Thing;
CREATE INDEX IX_Thing_Quantity ON dbo.Thing (Quantity, ID) 
INCLUDE (AdditionGroupID);

Where now the bottom part is improved to use the nonclustered index (without a key lookup) instead of the clustered index :

enter image description here

Lastly, as mentioned by you, you could add an indexed view to the first part of the view. Remember to use NOEXPAND for best performance, even in Enterprise edition.

datetime – View based on months or days – display certain items during specified times of the year

I am trying to create a calendar-type view that will display links to specific nodes during certain months of the year. For example, this would show ‘Taxes’ in Feb and April, ‘Travel’ from May to September, etc.

So far I have added a boolean field to my node to appear in the view, but I am stuck on how to implement the date selector. Theoretically I would like to have people select the months that this node should appear in the view, and the view will contextually display the nodes depending on the current month.

The problems I’m running into are:

  • The date field seems to require a year, but I want this to be year agnostic
  • The date field doesn’t allow selection of multiple months

I am thinking that I will have to use a date field so that I can use contextual filters to display based on month of the year. I don’t have access to the codebase so I need to do all of this within the UI using modules, if possible.

Any tips on how I can achieve this?

9 – View to get information for the user entity reference using contextual filters

I have two content types and each one has a user entity reference field. I want a view using contextual filter that shows the information of the content types when I pass the user ID referenced for the user entity reference field.

content-type 1: field -> studies, field -> id-user-entity-reference
content-type 2: field -> experience, field -> id-user-entity-reference

I want to get for example studies and experience in a view when I have a path similar like that:

/content/id-user-entity-reference (not the logged user, not the author id of the content type)

I need these results can be exposed via rest.

How can I configure my view to achieve that?