Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm new in sentiment140 web connector in Qlik Sense. I found some documents about Sentiment 140 Qlik web connector, but it works very slow. Is there any way to optimize it?
let vQwcConnectionName = 'lib://----------------';
Sub urlEncode(str)
let str=replace(str, '%', '%25'); // should be first
let str=replace(str, '#', '%23');
let str=replace(str, ' ', '%20');
let str=replace(str, '$', '%24');
let str=replace(str, '&', '%26');
let str=replace(str, '+', '%2B');
let str=replace(str, ',', '%2C');
let str=replace(str, '/', '%2F');
let str=replace(str, '\', '%5C');
let str=replace(str, ':', '%3A');
let str=replace(str, ';', '%3B');
let str=replace(str, '=', '%3D');
let str=replace(str, '?', '%3F');
let str=replace(str, '@', '%40');
let str=replace(str, '[', '%5B');
let str=replace(str, ']', '%5D');
let str=replace(str, '>', '%3E');
let str=replace(str, '<', '%3C');
let str=replace(str, chr(10), '%0A'); // Line feed.
let str=replace(str, chr(39), '%27'); // 39 Apostrophe
End sub
LET noRows = NoOfRows('TwitterConnector_Search');
for i=0 to $(noRows)-1
let text = peek('Search_text', $(i), 'TwitterConnector_Search');
let textEncoded = text;
call urlEncode(textEncoded);
Sentiment:
LOAD
'$(text)' as text,
status as Sentiment_status,
text as Sentiment_text,
score as Sentiment_score
FROM [$(vQwcConnectionName)]
(URL IS [http://localhost:5555/data?connectorID=TextAnalyser_Sentiment140Connector&table=Sentiment&text=$(tex...);
Any help would be greatly appreciated!
Hi,
This page may help:
It describes an advanced topic where instead of making multiple requests to a table inside a for/next loop, you can first store all the iterations of the parameters into a csv file and then point the connector to this to process in a more efficient way.