Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
maxsheva
Creator II
Creator II

String limitation

Hi,

I have found a limitation in Qlik Sense (didn't check in QlikView) in a string of a Field name.

Please see "QV script - Fails" as attachment. It fails when try to load  "Field149"

If remove "Field149" from script rows 3,9 it will work properly (see file "QV script - OK")

 

I need to generate string for further insert into SQL. Currently I didn't find another way how to create the same result.

 

Any help will be much appreciated!

12 Replies
maxsheva
Creator II
Creator II
Author

Thanks Marcus,

I have tried to understand how to implement your suggested solution but still not quite clear.

I need to get a result with a combined and delimited values from existing table. 

If I use in a variable a content such as Field1,Field2,Field3 it will not give me  'Field1', 'Field2', 'Field3' as result.

 

csv-output is a good idea. I will think about it.

 

Thank you!

marcus_sommer

My suggestion was related to your first load-statement which looked like creating a field-list for loading data within a load-statement and contained therefore no wrapping single-quotes. But you could just add them. Also the more essential part of my suggestion was to create a complete string within the variable and not an expression.

- Marcus

marksouzacosta
Partner - Creator II
Partner - Creator II

Do you need to pass all the values at the same time in one single INSERT statement?

If you don't you can call an insert command for each one of the data rows that you have, so your code will be something like:

[DataSource]:
LOAD ........(something);

For vIndex = 0 To NoOfRows('DataSource') - 1

//Build your query inside here

LET vField1 = Peek('Field1',vIndex,'DataSource');
LET vField2 = Peek('Field2',vIndex,'DataSource');
LET vFieldn = Peek('Fieldn',vIndex,'DataSource');

SQL INSERT INTO YourTable
(
[Field1],
[Field2],
[Fieldn]
)
VALUES
(
'$(vField1)',
'$(vField2)',
'$(vFieldn)'
)
;

Next vIndex
Read more at Data Voyagers - datavoyagers.net