Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
simonb2013
Creator
Creator

Inline Load - missing field vauls

 

I am loading some inline data.

When I iterate the rows, some data 'appears' to be missing from fields.

The data is missing where the field value is the same as the rows above it. ('athena' & '*')
i.e. if I make all values unique, then my output correctly shows values for every row & every field.
I assume that this is either something to do with escaping, or  column storage, but how to handle it I am unsure ?

R:
LOAD * Inline [
   rule;                                   service;           resource;       formula
   rle_xist_ProductID;    athena;            *;                      if(len(tag_ProductID)>0,'Y','N')
   rle_xist_Name;             athena;            *;                      if(len(tag_Name)>0,'Y','N')
](delimiter is ';');

LET NumRows=NoOfRows('R');

FOR i=1 to $(NumRows)
  LET vRle = FieldValue('rule', $(i));
  LET vSvc = FieldValue('service', $(i));
  LET vRsc = FieldValue('resource', $(i));
  LET vFml = FieldValue('formula', $(i));
  Trace '[] -------';
   Trace '[] $(vRle)';
   Trace '[] $(vSvc)';
   Trace '[] $(vRsc)';
   Trace '[] $(vFml)';
   NEXT

 

Output

R << b8994efd-61b7-410b-9ebb-847463dea003

Lines fetched: 2

'[] -------'

'[] rle_xist_ProductID'

'[] athena'

'[] *'

'[] if(len(tag_ProductID)>0,''Y'',''N'')'

'[] -------'

'[] rle_xist_Name'

'[] '

'[] '

'[] if(len(tag_Name)>0,''Y'',''N'')'

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Fieldvalue() is not the right function to use in this case, try using peek() instead, like:

FOR i=0 to $(NumRows)-1
LET vRle = Peek('rule', $(i));
LET vSvc = Peek('service', $(i));
LET vRsc = Peek('resource', $(i));
LET vFml = Peek('formula', $(i));
Trace '[] -------';
Trace '[] $(vRle)';
Trace '[] $(vSvc)';
Trace '[] $(vRsc)';
Trace '[] $(vFml)';
NEXT 

View solution in original post

2 Replies
tresesco
MVP
MVP

Fieldvalue() is not the right function to use in this case, try using peek() instead, like:

FOR i=0 to $(NumRows)-1
LET vRle = Peek('rule', $(i));
LET vSvc = Peek('service', $(i));
LET vRsc = Peek('resource', $(i));
LET vFml = Peek('formula', $(i));
Trace '[] -------';
Trace '[] $(vRle)';
Trace '[] $(vSvc)';
Trace '[] $(vRsc)';
Trace '[] $(vFml)';
NEXT 

simonb2013
Creator
Creator
Author

Many thanks, that did the trick - looks like I need to brush up on some basics!

After that, I also note that iteration is zero-based index.