Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

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

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

Try

LOAD

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

RESIDENT Data;

Highlighted
MVP & Luminary
MVP & Luminary

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

Highlighted
Specialist
Specialist

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

Highlighted
MVP & Luminary
MVP & Luminary

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

Highlighted
Specialist
Specialist

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

Highlighted
Partner
Partner

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

Highlighted
MVP & Luminary
MVP & Luminary

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