Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Olá,
Gostaria de saber se tem como fazer isso:
LOAD * INLINE [
ID, Observação
1, lorem ipsum
2, loremipsum
]
E eu quero que o valor desse meu campo observação fique como:
lo/re/m /ip/su/m
lo/re/mi/ps/um
Ou seja, para cada duas letras, incluir um '/'.
É possível? Pode ser tanto no script quanto no layout.
Obrigada!
this seems better
table:
LOAD * INLINE [
ID, Note
1, lorem ipsum
2, loremipsum
3,abcde
];
for r=0 to NoOfRows('table')-1
let s=Peek('Note', $(r), 'table');
let id=Peek('ID', $(r), 'table');
let newnote='';
for rr=1 to ceil(len('$(s)')/2)
let newnote='$(newnote)' & mid('$(s)', ($(rr)-1)*2+1, 2) & '/';
NEXT;
let newnote=left('$(newnote)', len('$(newnote)')-1);
newtable:
load '$(id)' as ID, '$(newnote)' as NewNote AutoGenerate 1;
NEXT;
RESULT
SCRIPT
table:
LOAD * INLINE [
ID, Note
1, lorem ipsum
2, loremipsum
];
for r=0 to NoOfRows('table')-1
let s=Peek('Note', $(r), 'table');
let id=Peek('ID', $(r), 'table');
let newnote='';
for rr=1 to len('$(s)')/2
let newnote='$(newnote)' & mid('$(s)', ($(rr)-1)*2+1, 2) & '/';
NEXT;
newtable:
load '$(id)' as ID, '$(newnote)' as NewNote AutoGenerate 1;
NEXT;
this seems better
table:
LOAD * INLINE [
ID, Note
1, lorem ipsum
2, loremipsum
3,abcde
];
for r=0 to NoOfRows('table')-1
let s=Peek('Note', $(r), 'table');
let id=Peek('ID', $(r), 'table');
let newnote='';
for rr=1 to ceil(len('$(s)')/2)
let newnote='$(newnote)' & mid('$(s)', ($(rr)-1)*2+1, 2) & '/';
NEXT;
let newnote=left('$(newnote)', len('$(newnote)')-1);
newtable:
load '$(id)' as ID, '$(newnote)' as NewNote AutoGenerate 1;
NEXT;
Thanks!
Very helpful!!!!
if you get the answer to your question, please close the thread (mark correct and/or helpful), thanks and good qlik