Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

elena888
Valued Contributor

Problem with FieldValue

Hi,

I would like to use the FieldValue function but I obtain a strange result: instead of 1, the result is a question mark... why?

QuestionMark.png

This is my code:

Data:

load * Inline [

Num

1

2

3

4];

LOAD

FieldValue('Num', 1) as FirstNum

Resident Data;

Thanks,

Elena

Tags (1)
1 Solution

Accepted Solutions
maximiliano_vel
Contributor III

Re: Problem with FieldValue

You could use the same approach i mentioned above

Dati:

load * Inline [

Numero

1

2

3

4

5

6

];

LOAD

max(Num(FieldValue('Numero',RecNo()))) as Maximum

AutoGenerate FieldValueCount('Numero');

7 Replies
maximiliano_vel
Contributor III

Re: Problem with FieldValue

Try

LOAD

  Num(FieldValue('Num',1)) as FirstNum

RESIDENT Data;

MVP & Luminary
MVP & Luminary

Re: Problem with FieldValue

For some reasons couldn't qv create or interpret the string-representation for this field (there are other cases in which this happens, too) and therefore it displayed the "?" as placeholder. The suggestion from maximiliano.velez with num() or a dual() will solve it.

- Marcus

elena888
Valued Contributor

Re: Problem with FieldValue

Thank you guys.

The example above was just a test.... my aim is to use  Rob Wunderlich's code below to get max value in order to improve performance:

LOAD

max(FieldValue('ID', recno())) as Maximum

AUTOGENERATE FieldValueCount('ID');

So, in your opinion, will I ever be able to use this function (I use QV 11 SR3?)? Is there a solution?

Elena

MVP & Luminary
MVP & Luminary

Re: Problem with FieldValue

The solution from Rob worked - I have used it several times, recently with QV 11 SR8 but I don't believe that there is an issue with SR3. What didn't worked like you expected it?

- Marcus

elena888
Valued Contributor

Re: Problem with FieldValue

My problem is that the result of the code below is a question mark

Dati:

load * Inline [

Numero

1

2

3

4

5

6

];

LOAD

max(FieldValue('Numero',RecNo())) as Maximum

AutoGenerate FieldValueCount('Numero');

Is there an error in my code? Do I have to do some settings in the document properties?

Elena

maximiliano_vel
Contributor III

Re: Problem with FieldValue

You could use the same approach i mentioned above

Dati:

load * Inline [

Numero

1

2

3

4

5

6

];

LOAD

max(Num(FieldValue('Numero',RecNo()))) as Maximum

AutoGenerate FieldValueCount('Numero');

MVP & Luminary
MVP & Luminary

Re: Problem with FieldValue

Like above mentioned qlikview failed by the string-interpretation which normally worked automatically. Therefore you need to create these string-interpretation with function which automatically create a dual-field like formatting-functions like num() or you used dual() itself. A quite similar case is here loading a field with distinct values and it worked with dual().

- Marcus