Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

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

View solution in original post

7 Replies
Highlighted
Partner
Partner

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

Partner
Partner

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

View solution in original post

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