Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
This is my code:
Data:
load * Inline [
Num
1
2
3
4];
LOAD
FieldValue('Num', 1) as FirstNum
Resident Data;
Thanks,
Elena
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');
Try
LOAD
Num(FieldValue('Num',1)) as FirstNum
RESIDENT Data;
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
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
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
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
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');
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