Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've got a log file that I'm trying to process. The start of each new record is "Number of executions" and the last field is "Statement text". Unfortunately this Statement text may extend to several lines but I want everything after "Statement text =" to be loaded in to a single field. I've tried several different things but have not found a solution. Is this possible?
Hi David, it looks like some of the Statement text is missing:
I guess I figured out now. It was missing because of the text delimiter =.
Thanks David - that's great. I'm just trying to understand the scripting and have a question about this:
TextBetween(@1, '=','')
That's obviously returning the text of '@1' between the Equal Sign '=' and ''...
...does the 2 single quotes '' simply mean end of the line?
Unfortunately when I ran Log-clean.qvw against my entire log file I found it didn't concat the rows in the correct order. For example the following Statement text:
= SELECT COUNT(*) FROM (SELECT * FROM V_GENERIC_CASES_NOTES WHERE Classification = 'Enquiry/ Orders'
and (CASE_OVERVIEW LIKE
'%CHARITY COMMISSION ORDER%'
or CASE_OVERVIEW LIKE
'%Charity Commision Order%'
or CASE_OVERVIEW LIKE
'%Charity commision order%'
or CASE_OVERVIEW LIKE
'%charity commision order%'
) AND CREATED_DATE >= ? AND CREATED_DATE <= ? AND ((ORGUNIT_ID IN (1063,1083,1084,1085,1173,1240,1252))) FETCH FIRST 15000 ROWS ONLY ) countTableAlias
Got rebuilt as:
SELECT COUNT(*) FROM (SELECT * FROM V_GENERIC_CASES_NOTES WHERE Classification = 'Enquiry/ Orders' '%CHARITY COMMISSION ORDER%' '%Charity Commision Order%' '%Charity commision order%' '%charity commision order%' ) AND CREATED_DATE >= ? AND CREATED_DATE <= ? AND ((ORGUNIT_ID IN (1063,1083,1084,1085,1173,1240,1252))) FETCH FIRST 15000 ROWS ONLY ) countTableAlias and (CASE_OVERVIEW LIKE or CASE_OVERVIEW LIKE or CASE_OVERVIEW LIKE or CASE_OVERVIEW LIKE
Therefore I combined the two scripts from daveamz01 and to perumal_41 getting a working solution.
I've just figured out that all I needed to do was add the sort-weight to the concat:
Hi,
PFA
Yes, I used '' for end of the line. It seems qlikview can't handle '\r\n' (end of line for Windows text file).