Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Kirsten
Creator II
Creator II

Expression

What is going wrong with this expression. It is exactly the same as another one that is working , but then of course modified with the relevant values 

Max({$<[Period]-={'2020 Q4'}>}First Time Right)

 Expression.PNG

3 Solutions

Accepted Solutions
GaryGiles
Specialist
Specialist

Do you need [] brackets around your field name?

 

Max({$<[Period]-={'2020 Q4'}>} [First Time Right])

View solution in original post

RayArina
Contributor III
Contributor III

I guess @GaryGiles  is right
you need [] around your fields
because 'first', 'time' and 'right' are functions in themselves

Or you can rename youк field 'First Time Right' to something else, for example, 'First _Time_Right'

You should avoid using space in your field`s names

View solution in original post

RayArina
Contributor III
Contributor III

you forgot ' befor 2020

try this, pls))

Max({$<[Period]-={'2020 Q4'}>} [FirstTimeRight])

View solution in original post

8 Replies
GaryGiles
Specialist
Specialist

Do you need [] brackets around your field name?

 

Max({$<[Period]-={'2020 Q4'}>} [First Time Right])

Kirsten
Creator II
Creator II
Author

@GaryGiles   No it is not needed, but when removing them it still gives the errorExpression-1.PNG

RayArina
Contributor III
Contributor III

I guess @GaryGiles  is right
you need [] around your fields
because 'first', 'time' and 'right' are functions in themselves

Or you can rename youк field 'First Time Right' to something else, for example, 'First _Time_Right'

You should avoid using space in your field`s names

GaryGiles
Specialist
Specialist

I thought [ ] were always needed when referencing a field name that includes spaces.

GaryGiles
Specialist
Specialist

After the [ ], the other thing I would look into is the field type of [First Time Right].  If it is not numeric, you will want to use Maxstring. 

Kirsten
Creator II
Creator II
Author

Hi thanks @GaryGiles  @RayArina  I did 2 things I reloaded the file with field names without spaces and I also added the brackets to the fieldnames, though it still returns the error. The values in FirstTimeRight are numeric. Also not sure why the fieldname FirstTimeRight does not return yellow, it is 100% sure the correct fieldname (see screenshot). It is probably a small thing, but I don't see it

 

Expression-2.PNG

Fieldname.PNG

RayArina
Contributor III
Contributor III

you forgot ' befor 2020

try this, pls))

Max({$<[Period]-={'2020 Q4'}>} [FirstTimeRight])

GaryGiles
Specialist
Specialist

Any chance the fieldnames (Period, FirstTimeRight) in the data model has different cases for letters (upper/lower) than your expression?  Qlik is very case sensitive.