Databand Filter: X AND (Y OR Z)
Databand Filter: X AND (Y OR Z)
I am trying to do the following data filter:
"CODE=UC" AND ("_KUNDE=ALLE" OR "_KUNDE=KUNDE1")
shorter version to understand better: X AND (Y OR Z)
How can I do that with the designer?
"CODE=UC" AND ("_KUNDE=ALLE" OR "_KUNDE=KUNDE1")
shorter version to understand better: X AND (Y OR Z)
How can I do that with the designer?
- Attachments
-
- filter
- filter.PNG (72.07 KiB) Viewed 2932 times
Re: Databand Filter: X AND (Y OR Z)
Hello.
You could add such filter by switching the Field Is to Expression and write your filter expression there. Thank you.
You could add such filter by switching the Field Is to Expression and write your filter expression there. Thank you.
Re: Databand Filter: X AND (Y OR Z)
thanks for the fast response.
How would my expression look like?
Related_Requirements.Code = "UC" AND (Related_Requirements._Kunde = "ALLE" OR Related_Requirements._Kunde = "KUNDE1")
How would my expression look like?
Related_Requirements.Code = "UC" AND (Related_Requirements._Kunde = "ALLE" OR Related_Requirements._Kunde = "KUNDE1")
Re: Databand Filter: X AND (Y OR Z)
This does work
Related_Requirements.Code.Substring(0,2) == "UC"
However, if I try to relate them with AND and OR, it doesnt. Any ideas?
Related_Requirements.Code.Substring(0,2) == "UC" AND (Related_Requirements._Kunde = "ALLE" OR Related_Requirements._Kunde = "KUNDE1")
Edit:
Neither does it works with logical operators from C
Related_Requirements.Code.Substring(0,2) == "UC" && (Related_Requirements._Kunde = "ALLE" || Related_Requirements._Kunde = "KUNDE1")
Related_Requirements.Code.Substring(0,2) == "UC"
However, if I try to relate them with AND and OR, it doesnt. Any ideas?
Related_Requirements.Code.Substring(0,2) == "UC" AND (Related_Requirements._Kunde = "ALLE" OR Related_Requirements._Kunde = "KUNDE1")
Edit:
Neither does it works with logical operators from C
Related_Requirements.Code.Substring(0,2) == "UC" && (Related_Requirements._Kunde = "ALLE" || Related_Requirements._Kunde = "KUNDE1")
Re: Databand Filter: X AND (Y OR Z)
Hello.
You could use either C# or VB.NET syntax. It depends on the Script Language property of a report. If you want to use VB.NET syntax, you should set the Script Language property of the report to VB.
Thank you.
You could use either C# or VB.NET syntax. It depends on the Script Language property of a report. If you want to use VB.NET syntax, you should set the Script Language property of the report to VB.
Thank you.
Re: Databand Filter: X AND (Y OR Z)
I looked up, I am using C# as script language.
Why is this code still wrong?
Related_Requirements.Code.Substring(0,2) == "UC" && (Related_Requirements._Kunde = "ALLE" || Related_Requirements._Kunde = "KUNDE1")
Why is this code still wrong?
Related_Requirements.Code.Substring(0,2) == "UC" && (Related_Requirements._Kunde = "ALLE" || Related_Requirements._Kunde = "KUNDE1")
Re: Databand Filter: X AND (Y OR Z)
Hello.
Thank you.
Please, try to use next code:jmmv2005 wrote:I looked up, I am using C# as script language.
Why is this code still wrong?
Related_Requirements.Code.Substring(0,2) == "UC" && (Related_Requirements._Kunde = "ALLE" || Related_Requirements._Kunde = "KUNDE1")
Code: Select all
Related_Requirements.Code.Substring(0,2) == "UC" && (Related_Requirements._Kunde == "ALLE" || Related_Requirements._Kunde == "KUNDE1")
Re: Databand Filter: X AND (Y OR Z)
Thanks, I now see I forgot to write ==.
There seems however to be a bug in the system.
Some elements of "Related_Requirements._Kunde" on my DB have "ALLE" as value, others have "KUNDE1", "KUNDE2", ...
I want to select all elements that have the value "ALLE" or "KUNDE1".
On specific elements of "Related_Requirements._Kunde" on my DB has these two values: "KUNDE1" and "KUNDE2"
With this query, the element is not selected.
If I use this query, the element is selected.
Now if we introduce a third value "KUNDE3", it will be selected if I use the second query. Is this a bug or where is the problem?
many thanks
There seems however to be a bug in the system.
Some elements of "Related_Requirements._Kunde" on my DB have "ALLE" as value, others have "KUNDE1", "KUNDE2", ...
I want to select all elements that have the value "ALLE" or "KUNDE1".
On specific elements of "Related_Requirements._Kunde" on my DB has these two values: "KUNDE1" and "KUNDE2"
With this query, the element is not selected.
Code: Select all
Related_Requirements.Code.Substring(0,2) == "UC" && (Related_Requirements._Kunde == "ALLE" || Related_Requirements._Kunde == "KUNDE1")
Code: Select all
Related_Requirements.Code.Substring(0,2) == "UC" && (Related_Requirements._Kunde != "KUNDE2")
many thanks
Re: Databand Filter: X AND (Y OR Z)
Hello.
Please, send us your report template with sample data for analysis.
Thank you.
Please, send us your report template with sample data for analysis.
Thank you.