Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I need to load a multiple line from text and store it into a single variable, can someone please help me on the same?
Below is the scenario:
I have a text file in the system with the name sample.txt with below data.
Sample.txt
ABCDEF
GEFG
JSDFR
Now i need to load the file in the qlikview and store all 3 line in a single varaible
vData = 'ABCDEF
GEFG
JSDFR'
Please guide me on how to achieve this?
Try this:
LET vData = Concat(FieldName, Chr(13))
Table:
LOAD * Inline [
FieldName
ABCDEF
GEFG
JSDFR
];
Temp:
LOAD Concat(FieldName, Chr(13)) as Concat
Resident Table;
LET vData = Peek('Concat');
DROP Table Temp;
Try this:
LET vData = Concat(FieldName, Chr(13))
Table:
LOAD * Inline [
FieldName
ABCDEF
GEFG
JSDFR
];
Temp:
LOAD Concat(FieldName, Chr(13)) as Concat
Resident Table;
LET vData = Peek('Concat');
DROP Table Temp;
Hi
Try like this
= Concat(Distinct FieldName, Chr(10))
Create a Variable
vVariable
definition
Concat(FieldName,CHR(10))
Use as below
=$(=vVariable)
Manish what is Chr(10)? Is it the same as Chr(13)???
Chr(10) is for Line Break
Chr(13) is for Carriage Return
Thank you All for the quick response..It helped me a lot.
But now i have one more doubt on the same.
I amusing the below script:
But what happen here is in Temp table the Concat feild get sorted automatically i want them to be in the same format as in my data. Can you please help me?
Table:
LOAD @1 as FieldName,
AutoNumber(@1) as FieldNo
FROM
(txt, codepage is 1252, no labels, delimiter is ',fdgfdfd', msq);
Temp:
LOAD Concat(FieldName, Chr(13)) as Concat
Resident Table order by FieldNo;
LET vData = Peek('Concat');
Hi
In that case, remove the order by statement.
Temp:
LOAD Concat(FieldName, Chr(13)) as Concat
Resident Table;
LET vData = Peek('Concat');
Hi,
It did not helped my friend, with or without order by
Try this:
Table:
LOAD *,
RowNo() as Sort
Inline [
FieldName
ABCDEF
JSDFR
GEFG
];
Temp:
LOAD Concat(FieldName, Chr(13), Sort) as Concat
Resident Table;
LET vData = Peek('Concat');
DROP Table Temp;