Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Im new here and I would like to make an simple example to Use SubField Funtion.
I Used in Load Script on Qliksense:
MyTable:
LOAD
TEXT(SubField("String",'-',1)) AS "Title Chars",
NUM (SubField("String",'-',2)) AS "Title Num", // Delimiter is '-' / Is not necesary declare on the script. And Separe the string (" Hello-123", in Title Chars: "hello" and Title Num: "123"
I hope to help someone.
Best Regards
What if string has like "Hello-World-123" ?? Or every time "Hello-123" only?
Use, Simple as much
MyTable:
LOAD
SubField("String",'-',1) AS "Title Chars",
SubField("String",'-',2) AS "Title Num";
Hello
and you can use the LEFT and RIGHT functions too:
//Hello-123
MyTable:
LOAD
TEXT(left(string,index(string,'-')-1) AS "Title Chars", // Hello
NUM (right(string,index(string,'-')+1) AS "Title Num", //123
For Hello-World-123, you can do:
MyTable:
LOAD
SubField("String",'-',1) AS "Title Chars",
SubField("String",'-',2) AS "Title Chars2",
SubField("String",'-',3) AS "Title Num";
..Test and comment us!