Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ribeiro
Specialist
Specialist

I'm having a script problem.

When it's the same

TMP:

LOAD * Inline

[

field,Rep

123123,5

312312,5

312314,5

];

The Rep record does not let itself be repeated, it is giving this error.

Example below it leaves because the REP field are different

2017-11-29_15-38-25.png

Here it works because REP is different

TMP:

LOAD * Inline

[

field,Rep

123123,5

312312,3

312314,8

];

FOR i = 1 TO NoOfRows('TMP')

LET vTbl = FieldValue('field', $(i));

LET vCon = previous(FieldValue('Rep',     $(i)));

  TRACE $(vCon);

sumary:

LOAD '$(vTbl)' AS MyField,

$(vCon)  AS MyRep,

RecNo()  AS CONT

AutoGenerate $(vCon)

;

NEXT

DROP Table TMP;

EXIT Script;

Neves
1 Solution

Accepted Solutions
luismadriz
Specialist
Specialist

Hi,

You may want to use this instead?

LET vTbl = Num(Peek('field', i-1, 'TMP'));

LET vCon = Num(Peek('Rep', i-1, 'TMP'));

I hope it helps,

Cheers,

Luis

View solution in original post

2 Replies
luismadriz
Specialist
Specialist

Hi,

You may want to use this instead?

LET vTbl = Num(Peek('field', i-1, 'TMP'));

LET vCon = Num(Peek('Rep', i-1, 'TMP'));

I hope it helps,

Cheers,

Luis

Ribeiro
Specialist
Specialist
Author

Obrigado Luiz. Estava com presa.

Neves