Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
March 11, 2PM EST: Do More with Qlik - Getting Started wtih Qlik Sense SaaS - Redux. REGISTER NOW
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 

View solution in original post

simonb2013
Creator
Creator

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.