Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
i want to use Peek function to get a value of a specific row but the IDs of field is not a type of integer ,it is a type of uniqueidentifier like
00000000-0000-0000-0000-000000000001
so i want to convert this id to number of type int like : 00000000-0000-0000-0000-000000000001 ==> 1
please can help me to do that .
jvs
Recno() is a Qlik function, not a SQL function.
You can use a preceding LOAD:
LOAD *,
Recno() as RecID;
SQL SELECT GUID, ...
FROM ....;
Hi,
Please try this: Replace(Ltrim(Replace(KeepChar('0000-0000-000000000001', '0123456789'),0,' ')),' ',0)
It will convert your GUID to Int.
example of text to fetch out desired result
mid( '00000000-0000-0000-0000-000000000001',FindOneOf('00000000-0000-0000-0000-000000000001','123456789'),len('00000000-0000-0000-0000-000000000001')-1)
in general
mid( fieldname,FindOneOf( fieldname,'123456789'),len( fieldname)-1)
Sorry for my ignorance. GUID is 128 bit-integer and it contains not only numbers but also letters. So we can not use the above approach.
Hi Mr. sunil
I tried your way but i got the same GUID value
it was "{00000000-0000-0000-0000-000000000001}" and got "00000000-0000-0000-0000-000000000001)"
I'll jump in although I'm not sure any of us understand what you are actually trying to do
Lookup('targetField', 'ID', ID, 'targetTable)
-Rob
using this , i getting 1 as a result.
Take below expression in text box
=mid( '00000000-0000-0000-0000-000000000001',FindOneOf('00000000-0000-0000-0000-000000000001','123456789'),len('00000000-0000-0000-0000-000000000001')-1)
here i am taking '00000000-0000-0000-0000-000000000001' as Example screen which
you can use this for genralized
use below in script
mid( fieldname,FindOneOf( fieldname,'123456789'),len( fieldname)-1) as Newfieldname ///try this in script
and see the result in Newfieldname at front end
Maybe my explanation was not clear
i have this table :
If i want to get the fourth value in the Name field which is BattlePlace i should use Peek function,
but in order to use peek function in such form : let vYourRow= Peek('NewField',Position(numeric), 'table');
i need numeric value but my ID field is not numeric it is GUID and i do not want to generate a new numric field using Recno() so how can i solve this issue to use Peek function.
@rob_wunderlich
If you know you want to query the fourth record in your table, just input 4:
Peek('NewField',4, 'table');
Hi Mr. Stefan
due to some processes in my script i can not know the value (4), i have only GUID value which is 00000000-0000-0000-0000-00000000004.