Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

1 Solution

Accepted Solutions
maximiliano_vel
Partner - Creator III
Partner - Creator III

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');

View solution in original post

7 Replies
maximiliano_vel
Partner - Creator III
Partner - Creator III

Try

LOAD

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

RESIDENT Data;

marcus_sommer

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

Anonymous
Not applicable
Author

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

marcus_sommer

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

Anonymous
Not applicable
Author

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
Partner - Creator III
Partner - Creator III

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');

marcus_sommer

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