Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/1122.QVapp.rar:550:0]
In the pic below I'm showing whats the case:
I'm trying to catch some strings from the field images and put them cleared in another table, but the script I'm using don't do that correctly but seem to working to the 6th line fine!
In the attached app you can see it.
I've trying to fix the bug in the app but without any success ... please help!
Thanks in advance!
Hi,
As I mentioned above, the code above works with a small tuning:
for h=1 to NoOfRows('main2') data2.1:LOAD $(h) as ID, substringcount(imagess, '.jpg') as JPGInstances, RecNo() as images_recNo, TextBetween(SubField(imagess, 'alt='), '/Autotest/', '.jpg') as final_imagesRESIDENT main2 WHERE ID = $(h); next
Please take into account that the people that participate in the QlikCommunity don't have your data model, nor we work for QlikView, so some ideas will need refination from your end.
Hope that helps.
Ivan,
it took me a few minutes to find the catch... You are using function fieldvalue(), which is giving you an X-th element from the list of field values. So, you expected to see the first line under number 1, the 7th line under number 7 and the 11th line under number 11... Well, the catch is that the List with field values only stores distinct values, so your line # 11 contains 7th distinct value of the field imagess - that's why the images from line 11 got registered under number 7...
In order to get correct values, replace FieldValue() with function Peek(), where you can specify the table name and the row number in the table, to get the accurate value without any de-duplication problems.
cheers,
Use that function let vImages = text(peek('imagess',$(h)-1,main2)); but it gives only the first line info !
?
Any ideas ?
I've changed a bit your script
for h=1 to NoOfRows('main2') data2.1:LOAD Distinct $(h) as ID, substringcount(imagess, '.jpg') as JPGInstances, RecNo() as images_recNo, SubField(textbetween(imagess, '/Autotest/', '.jpg'), '=') as final_imagesRESIDENT main2 WHERE ID = $(h); next
Obviously this needs some tuning, but the idea is that the SubField() function, unless a count number is specified, will create as many records as separators it will find in the string:
Example:LOAD SubField(Field, '=') AS Field INLINE [FieldA=B=CD=E=FG=H=I];
But I'm afraid I'm unable to get how you want to split your code exactly.
Hope that helps.
Ahmm ... , another ideas how to do that work ?
?
Hi,
As I mentioned above, the code above works with a small tuning:
for h=1 to NoOfRows('main2') data2.1:LOAD $(h) as ID, substringcount(imagess, '.jpg') as JPGInstances, RecNo() as images_recNo, TextBetween(SubField(imagess, 'alt='), '/Autotest/', '.jpg') as final_imagesRESIDENT main2 WHERE ID = $(h); next
Please take into account that the people that participate in the QlikCommunity don't have your data model, nor we work for QlikView, so some ideas will need refination from your end.
Hope that helps.
Ooo, that's great ! Thanks! It works !!! 🙂
Thanks again for the help!