Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
employe4_2
Contributor III
Contributor III

LOADING data from Array

Hi,

 

I'm trying to load some data from a database and some fields are array type. And from this point i cant load anymore. I looked for some solution, to load array types but i cant get it.

All i have access is : the name of the ArrayField: [vProfileB12]

And i know inside there is just raw data : [ 1,5,4,8,3,...,]

I tried subfield(vProfileB12, ',') But still geting some error

Any hint ?

7 Replies
y_grynechko
Creator III
Creator III

Temp:
LOAD Product,Subfield(Value,';') as Value,'Value_sales_period'&AutoNumber(RowNo(),Product) as Period
Inline [
Product,Value
A,1;2;3;4;5;6;7;8;9;10;11;12
B,11;12;13;14;15;16;17;18;19;110;111;112];
Generic LOAD Product,Period,Value
Resident Temp;
Drop Table Temp;

employe4_2
Contributor III
Contributor III
Author

HI thanks for the hint! .. But there are still some things i wonder.

The name of the Array field i try to get is [vProfileB12], i just have 50 values describing a profil . You load 3 "items" , PRODUCT, PERIOD and VALUE. And  i work with only the Array's Name: i guess my Array's name correspond to your "VALUE" but for PRODUCT and PERIOD i don't get it.

 

More over i don't have any value to copy from anywhere, how do i get with :

Inline [
Product,Value
A,1;2;3;4;5;6;7;8;9;10;11;12 ===> ( up to 50 for me ?)
B,11;12;13;14;15;16;17;18;19;110;111;112];

 

even tho its calculated , the " Value_Sales_periode'  and AutoNumber(RowNo(),Product) doesn't mean anything to me so i kinda wonder whats is it for and where does it come from

 

y_grynechko
Creator III
Creator III

Simple version:

Temp:
LOAD *
Inline [
vProfileB12,ArrayValues
A,1;2;3;4;5;6;7;8;9;10;11;12;13;14;15];

NoConcatenate
Load
vProfileB12,Subfield(ArrayValues,';') as ArrayValues
Resident Temp;
Drop Table Temp;

employe4_2
Contributor III
Contributor III
Author

I'm getting still the same error,2019-11-26_16h36_01.png

I'm getting this array from a data base maybe it has to come from something like this .

 

the only array line i add make the whole loading script not loading. 

But still concerning your arrayValue: A,1,2,3,4,5,6,7,8,9,10... i don't know what it means ? is it the value i'm suppose to get , is it "indexation" or something like that. 2019-11-26_16h36_23.png

 

Help :'(

y_grynechko
Creator III
Creator III

Inline is the way to show the logic not to use it later on as a solution.

Delete the part of my code from your script.

Just load your table, with new field called what ever you want to call it, I called it ArrayValues(just as an example- but you can go with it). And use this logic to create it:

Subfield(NameOfTheFieldThatGetsAsAnArrayFromDB,'sign that separates the elements in the array') as ArrayValues

employe4_2
Contributor III
Contributor III
Author

HO ok ! your first explanations kinda troubled me... 

i understand subfield() but i never used INLINE, my bad

i feel like i miss a basic knowledge in load statement as if the order or the placement of the instruction are wrong.. : i make it the basic -est possible  but still get the same error 2019-11-27_10h01_55.png2019-11-27_10h05_50.png

i try to turn it around in every way i usually use to get things working, but still that same error  ...

what do i miss ??

y_grynechko
Creator III
Creator III

Can you share some data?