How can I filter nodes by property values and labels in using Cypher query? - cypher

I'm trying to use Cypher to perform a graph search that includes node filtering based on property values and label constraints. I want to find all nodes with a name property that starts with "Mc" and is labeled as Manufacturer.
I've tried the following code:
MATCH (n:Manufacturer)
WHERE n.name "Mc*"
RETURN n;

Use the STARTS WITH clause with WHERE condition:
WHERE n.name STARTS WITH 'Mc'
Everthing else remains the same in your query.

Related

SSRS Chart Data - Filtering options for Values?

I'm currently running Visual Studio 2010 for reporting for pharmaceutical batch production. The system creates archive data table with the following fields:
-VARIABLE, which is the name of the variable,
-TIMESTAMP, the time when the value of the variable was recorded,
-VALUE, the actual value of the variable at a specific timestamp,
and so on.
The dataset I'm concerned with contains 3 variables: Level, BatchTimer, and BatchID.
Goal: What I want to achieve is to have Level as the Y value, BatchTimer as the X-axis(Category Group), and BatchID as the Series Group. Therefore I tried putting the VALUE field for all three regions, and adding filter options for the Category Group and the Series Group. Here are the filter options I added:
Filter Option for Category Group
Filter Option for Series Group
The problem now was filtering the Y value so that it only has field VALUE of Variable Level. I then assumed I needed to add a filtering expression to the value region of the chart data, which I don't know how to.
So my question is:
Is this the correct way to approach my goal?
If so, how would I go about filtering the Y value so that it only shows a certain variable in a dataset(in my case, Level)?
Thank you in advance!
If I understand your problem statement correctly, Your end goal is to filter out Level values, i.e For Example Level has values 1,2,3..10 but you want your Level values to be let's say only 3.
So return all data where level is 3. Once you have this datset, you are already able to add BatchTimer as the X-axis(Category Group), and BatchID as the Series Group.
You need a Parameter of a Filter in your dataset something like below.
Now above way is static for Level=3.
How do we make it dynamics
We create a Parameter and ask user to give level. Then depending on this parameter value we filter dataset as below ( this should be added to dataset query)
level field Operator: = and value of the parameter
(Parameters.level.Value)

Criteria to return all records if selection from form is both

I'm trying to pass multiple query criteria from form controls. I'm using
the following type of syntax for the criteria.
IIf([Forms]![ReportsForm]![cmbLvl]="ALL", "*", [Forms]![ReportsForm]![cmbLvl])
It works for the else clause. But it does not work for the ALL Scenario. Is there an easy way to make this work.
What I am trying to do is to return all records and not just one type. For example. On a table I want to be able to search for both Male and Female. Not just Male or vice versa. Not just female only too. But both.
I also tried Like Nz([Forms]![ReportsForm]![cmbLvl],"*") . That did not work also.
Use a parameter to return all records if Null shows how you can use a Null field value to lift that field's filter.
To adapt this, you could use:
[Forms]![ReportsForm]![cmbLvl]="All" OR [Forms]![ReportsForm]![cmbLvl]
If you need to show "ALL" as a combobox choice rather than just leaving it blank, consult Adding "All" to a listbox or combobox's part about creating a union query including a null value listed as "All".

BigQuery position function for element within a nested element

How do I get the position for a field nested in multiple level of records:
select position(repeatedRec.rec1.field)
where repeatedRec is a repeated record, and rec1 is a non-repeated record? Assume that repeatedRec doesn't have any other leaves. I need to know what is repeatedRec position for the element in which rec1.field resides.
This doesn't seem to work, and all I get is 1 (as if the system is treating the field as a non repeated field).
have you tried
select position(repeatedRec.rec1.field) WHITHIN repeatedRec.rec1 as f1
https://developers.google.com/bigquery/docs/data#within
see this link for a small documentation on within

SSRS: In a chart group by combining two datasets

I have a report that in the values I have 2 data sets, and then grouping by a location to display the data. If I use the one location within 1 dataset then sure one of the averages I am displaying is perfect but the other is incorrect showing the same result across the board.
No down I need to join these together to get an outcome.
here is what I have:
Values:
1. =Avg(Fields!Rating.Value)
2. =((sum(Fields!Low_rating.Value,"MIN_MAX_CCR") + sum(Fields!Max_rating.Value, "MIN_MAX_CCR")) / 2 ) / Count(Fields!Case_ID.Value, "MIN_MAX_CCR")
Category Grouping:
1.=lookup(Fields!CaseID.Value,Fields!Case_ID.Value, Fields!location.Value,"MIN_MAX_CCR")
So the first field is from the current dataset, the second is from the MIN_MAX_CCR dataset, the location is from the first data set, and then getting the data set for the case_ID.
Now when I run this I get this lovely error:
System.Web.Services.Protocols.SoapException: The Group expression for the grouping ‘Chart8_CategoryGroup’ refers to the field ‘location’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case.
at
I just cant see a way around this - I cant combine the data in one query due to the nature of the query differences.
You are trying to return location from MIN_MAX_CCR, but it doesnt exist.
I would read the documentation or intellisense hints on the Lookup function to learn how to write it correctly.

Why can't Aggregate and lookup functions be used in query parameter expressions in SSRS?

I'm using an if to run one query if the user selects all from a multivalued parameter, and the other if not. So I figured I'd compare selected parameters vs rows in the data set.
However I get this error:
“The expression used for the parameter 'DataSet2' in the dataset
'DataSet2' includes an aggregate or lookup function. Aggregate and
lookup functions cannot be used in query parameter expressions.”
Here's the part giving the issue:
IIf(Parameters!SomeOptions.Count < COUNTROWS("SOME_LIST"), ….
Of course supplementing the COUNTROWS("SOME_LIST") with 15 (the value it returns)works fine.
Anyone know why this happens, and/or any work around?
Here's a workaround I use in the absence of an IsSelectAll flag:
Add another internal parameter called InternalParameter_SomeOptions.
Set the default value and available values to equal the same data set as SomeOptions.
Set your expression to =IIF(Parameters!SomeOptions.Count <> Parameters!InternalParameter_SomeOptions.Count, nothing, Join(Parameters!SomeOptions.Value, "|"))
If you have a multi-selection parameter whose data source is a dataset and you want to know if ALL was checked, from within your REPORT Dataset (like an SQL) to filter properly, look no further!
Why does this matter? Say you have a dataset (love datasets as data source for parameters btw, save em on the server for reuse over and over) for displaying a vendor list for users to select one or more (multi) from. What if that list is 10,000 long. You do NOT want to use: WHERE VENDOR_ID IN(#VENDOR). If the list is long enough, it WILL bomb and you will have to hunt the error down in SSRS log. So, this is one reason why we need to check if ALL was selected.
Create a new parameter identical to the dataset parameter(so they both use the same dataset and have the same default values), make sure to set it to multi selection and hidden (you do not want users seeing it). I name mine ---All where --- is the name of my parameter to easily distinguish.
For the dataset that serves as your REPORT data, add an additional Parameter. I like to call it #Is----AllChecked where ---- is the name of my parameter. It is named as a boolean (1 for true, 0 for false). In this example, it would be named #IsVendorAllChecked.
In the DEFAULT value expression check if the count of each REPORT parameter is the same (the one the users use and the duplicate), and return a value, like 1 if the same 0 if not. For example =IIF(Parameters!Vendor.Count = Parameters!VendorAll.Count, 1, 0)
In your REPORT Dataset, evaluate the parameter value and act accordingly in your SQL: where ( (#IsVendorAllChecked = 1 and vendor_id = vendor_id) or (#IsVendorAllChecked = 0 and vendor_id in(#Vendor)))
#Vendor obviously being the parameter the user interacts.
Always wanted to contribute.
SE: Report Builder check if all was selected
SE: Report Builder how to check if all was selected
SE: Report Builder parameter query expression cannot use aggregates