OBIEE -- Syntax Error with Substring? - analysis

I'm looking at the following code as an edit to a field formula in an OBIEE analysis, yet returns an error. Any thoughts?
SUBSTRING("Dim - Vendor Header"."Dock Time",
LOCATE(':',"Dim - Vendor Header"."Dock Time")+1,
(CHAR_LENGTH("Dim - Vendor Header"."Dock Time") -
LOCATE(':',REVERSE("Dim - Vendor Header"."Dock Time")) -
LOCATE(':',"Dim - Vendor Header"."Dock Time")))
The error follows:
Formula syntax is invalid.
[nQSError: 10058] A general error has occurred. [nQSError: 43113] Message
returned from OBIS. [nQSError: 27002] Near <)>: Syntax error [nQSError:
26012] .Please have your System Administrator look at the log for more
details on this error. (HY000)
SQL Issued: SET VARIABLE DISABLE_CACHE_HIT=1; SELECT Substring ("Dim -
Vendor Header"."Dock Time", LOCATE(':',"Dim - Vendor
Header"."Dock Time")+1) FROM "XHSS - Vendor"
OK (Ignore Error)

Is there any function string REVERSE in obiee12c ?
Can you please try by giving only below part in formula, and check the same error is getting...
(CHAR_LENGTH("Dim - Vendor Header"."Dock Time") - LOCATE(':',REVERSE("Dim - Vendor Header"."Dock Time"))

Related

Garry's Mod Lua: Errors that request symbols that shouldn't be there?

I've been attempting to make a GMod gamemode, and as usual, lua is being annoying. It's requesting symbols that (as far as I know) shouldn't be there.
The errors:
gamemodes/gmdm/gamemode/init.lua:7: '(' expected near 'player_manager'
Code in question
function GM:PlayerSpawn
player_manager:SetPlayerClass( ply, "player_custom" )
Error:
gamemodes/gmdm/gamemode/player_class/player_custom.lua:4: '=' expected near 'player_manager'
1. unknown - gamemodes/gmdm/gamemode/player_class/player_default.lua:4
2. include - [C]:-1
3. unknown - gamemodes/gmdm/gamemode/shared.lua:1
4. include - [C]:-1
5. unknown - gamemodes/gmdm/gamemode/cl_init.lua:1
Code:
player_manager:SetPlayerClass( ply, "player_custom", )
(the other file lines it's referring to are the line include ("player_custom.lua") as well as shared.lua in cl_init.lua for some reason?)
Error:
gamemodes/gmdm/gamemode/shared.lua:10: attempt to call field 'Class' (a nil value)
1. unknown - gamemodes/gmdm/gamemode/shared.lua:10
Code:
player.Class( "player_default" )
player.Class( "player_custom" )
(it complains regardless of if it's Class or CLASS)
I have tried adding the symbols requested around the code but then it complains an unexpected symbol (presumably the ) ) is near the :
This one kind of confused me, as far as I know there's no reason there should be an = there.
As I said, I changed the capitalization, which didn't help.
I've been following the code from https://wiki.facepunch.com/gmod/Player_Classes as guide if using it as reference helps debug
Thank you very much for your time.

Where can I put test data that is not part of a model?

I want to test against a list of invalid email addresses. At the moment, they live in my setup method:
def setup
#invalid_email_addresses = [
'plainaddress',
'##%^%#$##$##.com',
'#domain.com',
'Joe Smith <email#domain.com>',
'email.domain.com',
'email#domain#domain.com',
'.email#domain.com',
'email.#domain.com',
'email..email#domain.com',
'あいうえお#domain.com',
'email#domain.com (Joe Smith)',
'email#domain',
'email#-domain.com',
'email#domain.web',
'email#111.222.333.44444',
'email#domain..com'
]
end
This makes the method rather long. I would like to move them to a yml file:
# test/fixtures/email_addresses.yml
invalid_email_addresses:
- 'plainaddress'
- '##%^%#$##$##.com'
- '#domain.com'
- 'Joe Smith <email#domain.com>'
- 'email.domain.com'
- 'email#domain#domain.com'
- '.email#domain.com'
- 'email.#domain.com'
- 'email..email#domain.com'
- 'あいうえお#domain.com'
- 'email#domain.com (Joe Smith)'
- 'email#domain'
- 'email#-domain.com'
- 'email#domain.web'
- 'email#111.222.333.44444'
- 'email#domain..com'
But that results in an error for each test:
ActiveRecord::Fixture::FormatError: fixture key is not a hash: /Users/stefan_edberg/Rails/tennis_app/test/fixtures/emaild_addresses.yml, keys: ["invalid_email_addresses"]
If not in fixtures, where should I put these email addresses?
The error shared itself conveys that there is some problem in parsing the YAML contents. I saved the following contents in a file test.yml on my Desktop
# test/fixtures/email_addresses.yml
invalid_email_addresses:
- 'plainaddress'
- '##%^%#$##$##.com'
- '#domain.com'
- 'Joe Smith <email#domain.com>'
- 'email.domain.com'
- 'email#domain#domain.com'
- '.email#domain.com'
- 'email.#domain.com'
- 'email..email#domain.com'
- 'あいうえお#domain.com'
- 'email#domain.com (Joe Smith)'
- 'email#domain'
- 'email#-domain.com'
- 'email#domain.web'
- 'email#111.222.333.44444'
- 'email#domain..com'
and then tried loading it from irb and it successfully loaded:
Please Note: Initially when I copied the YAML contents as it is in my file and tried loading it, I encountered parsing error and then I removed the following entry and tried again and the parse was successful
- 'あいうえお#domain.com'`
That entry contains Unicode characters. As YAML is indentation-sensitive copying that entry as it is in my file made the indentation inconsistent which caused parse error. Fixing the indentation for that entry made the parse successful.

How to disable the character limit in swiftlint config file

I am working on a project and i need to how to disable the character limit in swiftlint config file , so how to disable the character limit ??
Here is the swiftlint file
disabled_rules:
- force_cast
- force_try
- variable_name
- type_name
- file_length
- type_body_length
- cyclomatic_complexity
- function_body_length
- valid_docs
- trailing_whitespace
opt_in_rules:
- empty_string
excluded:
- Carthage
- Pods
- SwiftLint/Common/3rdPartyLib
line_length:
warning: 150
error: 200
ignores_function_declarations: true
ignores_comments: true
ignores_urls: true
custom_rules:
smiley_face:
name: "Smiley Face"
regex: '( :\))'
match_kinds:
- comment
- string
message: "A closing parenthesis smiley :) creates a half-hearted smile, and thus is not preferred. Use :]"
severity: warning
If you face some problem with this warning:
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'by' (identifier_name)
You can add these command to your configuration file:
variable_name:
max_length:
warning: 45
error: 60
min_length:
warning: 1
I hope this helps you and fits with your question.
I guess you can do it adding line_length inside disabled_rules, if that's what you mean.

Date cant save into database

I am new in groovy on grails.I am facing problem saving date from excelsheet into database. My date is of form 2014-02-15 . I made changes into config.groovy for date
grails.databinding.dateFormats = ['dd/mm/yyyy','yyyy-MM-dd']
But still it will show me error message like
ERROR context.GrailsContextLoader - Error initializing the application: Validation Error(s) occurred during save():
- Field error in object 'org.grails.importexcel.SandyData' on field 'purchaseOrderDate': rejected value [2014-02-15]; codes [org.grails.importexcel.SandyData.purchaseOrderDate.typeMismatch.error,org.grails.importexcel.SandyData.purchaseOrderDate.typeMismatch,sandyData.purchaseOrderDate.typeMismatch.error,sandyData.purchaseOrderDate.typeMismatch,typeMismatch.org.grails.importexcel.SandyData.purchaseOrderDate,typeMismatch.purchaseOrderDate,typeMismatch.java.lang.String,typeMismatch]; arguments [purchaseOrderDate]; default message [Could not find matching constructor for: java.lang.String(org.joda.time.LocalDate)]
Message: Validation Error(s) occurred during save():
Can anybody give me solutions for this.
Thanks
As I see you're trying to use JodaTime. Install Joda-Time plugin which provides integration with Joda and basic data bindings.

Image dissapears with "ResourceMeta - Resource not found"

In my Grails 2.2.4 project I'm having ERROR resource.ResourceMeta - Resource not found: /images/passenger.gif.
The problem is, that just after deployment the resource is accessible, but on day 2 or 3 it "expires", although it's still present under tomcat/webapps/ROOT/images.
In my gsp I'm using it like that:
<img src="${g.resource( dir:'images', file:'passenger.png' )}"/>

Resources