Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i have issue when trying to run this code can some one tell me why i am getting this error...
below is my code
//alog:
//LOAD
//
////@1,
//// @2,
//// @3,
//// @4,
//// @5,
//// @6,
//// @7,
//// @8,
//// @9,
//// @10,
//// @11,
//// @12,
//// @13,
//// @14,
//// @15,
//// @16,
//// @17,
//// @18,
//// @19,
//// @20,
//// @21,
//// @22,
//// @23,
//// @24,
//// @25,
//// @26,
//// @27,
//// @28,
//// @29,
//// @30,
//// @31,
//// @32,
//// @33,
//// @34,
//
// TextBetween(@1, 'date=','') as Alog_Date,
// mid([@1],6,7) as Alog_Month,
// mid([@1],6,4) as Alog_Year,
// mid([@1],11,2) as month,
//
// WeekDay(Right([@1],2))as Alog_WeekDay,
//
// right(@2,8)as Alog_time,
//
// //right(@3,8) as log_id,
// //right(@4,12) as msg_id,
// //Right(@5,16) as device_id,
//
// TextBetween(@3, 'log_id=','') as Alog_log_id,
// TextBetween(@4, 'msg_id=','') as Alog_msg_id,
// TextBetween(@5, 'device_id=','') as Alog_device_id,
// TextBetween(@6, 'vd="','"') as Alog_vd,
//
// TextBetween(@7&' '&@8&' '&@9&' '&@10,'timezone="','"') as Alog_timezone,
//
//
// TextBetween(@11, 'type=','') as Alog_type,
// TextBetween(@12, 'subtype="','"') as Alog_subtype,
// TextBetween(@13,'pri=','') as alogpri,
// TextBetween(@14, 'trigger_policy="','"') as Alog_trigger_policy,
// TextBetween(@15, 'severity_level=','') as Alog_severity_level,
// TextBetween(@16, 'proto=','') as Alog_proto,
// TextBetween(@17, 'service=','') as Alog_service,
// //TextBetween(@18, 'status=','') as status,
// //TextBetween(@19, 'reason=','') as reason,
//
// //TextBetween(@28&' '&@29,'msg="','"') as message,
// TextBetween(@18, 'action=','') as Alog_action,
// TextBetween(@19, 'policy=','') as Alog_policy,
// TextBetween(@20, 'src=','') as Alog_Source,
// TextBetween(@21, 'src_port=','') as Alog_src_port,
// TextBetween(@22, 'dst=','') as Alog_Destination,
// TextBetween(@23, 'dst_port=','') as Alog_dst_port,
//
//// TextBetween(@23, 'http_request_time=','') as http_request_time,
//// TextBetween(@24, 'http_response_time=','') as http_response_time,
//// TextBetween(@25, 'http_request_bytes=','') as http_request_bytes,
//// TextBetween(@26, 'http_response_bytes=','') as http_response_bytes,
//
// TextBetween(@24, 'http_method=','') as Alog_http_method,
// TextBetween(@25, 'http_url="','"') as Alog_http_url,
// TextBetween(@26, 'http_host="','"') as Alog_http_host,
// TextBetween(@27&' '&@28, 'http_agent="','"') as Alog_http_agent,
// TextBetween(@28, 'http_session_id=','') as Alog_http_session_id,
// //TextBetween(@32&' '&@33, 'msg="','"') as msg,
// //TextBetween(@34, 'srccountry="','"') as srccountry,
//
// //@30&' '&@31&' '&@32&' '&@33&' '&@34 as xxx,
// //TextBetween(@31&' '&@32&' '&@33, 'http_retcode="','"') as http_retcode,
// TextBetween(@29&' '&@30, 'msg="','"') as Alog_msg,
// TextBetween(@30&' '&@31, 'signature_subclass="','"') as Alog_signature_subclass,
// TextBetween(@31&' '&@32, 'signature_id="','"') as Alog_signature_id,
// TextBetween(@32&' '&@33, 'srccountry="','"') as Alog_srccountry
//
// //TextBetween(@28, 'http_session_id=','') as http_session_id
//
//FROM
//alog.csv
//(txt, codepage is 1252, no labels, delimiter is ',', msq);
//
////Store alog into alog.qvd;
alog:
LOAD Alog_Date,
Alog_Month,
Alog_Year,
month,
Alog_WeekDay,
Alog_time,
Alog_log_id,
Alog_msg_id,
Alog_device_id,
Alog_vd,
Alog_timezone,
Alog_type,
Alog_subtype,
alogpri,
Alog_trigger_policy,
Alog_severity_level,
Alog_proto,
Alog_service,
Alog_action,
Alog_policy,
Alog_Source,
Alog_src_port,
Alog_Destination,
Alog_dst_port,
Alog_http_method,
Alog_http_url,
Alog_http_host,
Alog_http_agent,
Alog_http_session_id,
Alog_msg,
Alog_signature_subclass,
Alog_signature_id,
Alog_srccountry
FROM
alog.qvd
(qvd);
Concatenate(alog)
alog:
LOAD
//@1,
// @2,
// @3,
// @4,
// @5,
// @6,
// @7,
// @8,
// @9,
// @10,
// @11,
// @12,
// @13,
// @14,
// @15,
// @16,
// @17,
// @18,
// @19,
// @20,
// @21,
// @22,
// @23,
// @24,
// @25,
// @26,
// @27,
// @28,
// @29,
// @30,
// @31,
// @32,
// @33,
// @34,
TextBetween(@1, 'date=','') as Alog_Date,
mid([@1],6,7) as Alog_Month,
mid([@1],6,4) as Alog_Year,
mid([@1],11,2) as month,
WeekDay(Right([@1],2))as Alog_WeekDay,
right(@2,8)as Alog_time,
//right(@3,8) as log_id,
//right(@4,12) as msg_id,
//Right(@5,16) as device_id,
TextBetween(@3, 'log_id=','') as Alog_log_id,
TextBetween(@4, 'msg_id=','') as Alog_msg_id,
TextBetween(@5, 'device_id=','') as Alog_device_id,
TextBetween(@6, 'vd="','"') as Alog_vd,
TextBetween(@7&' '&@8&' '&@9&' '&@10,'timezone="','"') as Alog_timezone,
TextBetween(@11, 'type=','') as Alog_type,
TextBetween(@12, 'subtype="','"') as Alog_subtype,
TextBetween(@13,'pri=','') as alogpri,
TextBetween(@14, 'trigger_policy="','"') as Alog_trigger_policy,
TextBetween(@15, 'severity_level=','') as Alog_severity_level,
TextBetween(@16, 'proto=','') as Alog_proto,
TextBetween(@17, 'service=','') as Alog_service,
//TextBetween(@18, 'status=','') as status,
//TextBetween(@19, 'reason=','') as reason,
//TextBetween(@28&' '&@29,'msg="','"') as message,
TextBetween(@18, 'action=','') as Alog_action,
TextBetween(@19, 'policy=','') as Alog_policy,
TextBetween(@20, 'src=','') as Alog_Source,
TextBetween(@21, 'src_port=','') as Alog_src_port,
TextBetween(@22, 'dst=','') as Alog_Destination,
TextBetween(@23, 'dst_port=','') as Alog_dst_port,
// TextBetween(@23, 'http_request_time=','') as http_request_time,
// TextBetween(@24, 'http_response_time=','') as http_response_time,
// TextBetween(@25, 'http_request_bytes=','') as http_request_bytes,
// TextBetween(@26, 'http_response_bytes=','') as http_response_bytes,
TextBetween(@24, 'http_method=','') as Alog_http_method,
TextBetween(@25, 'http_url="','"') as Alog_http_url,
TextBetween(@26, 'http_host="','"') as Alog_http_host,
TextBetween(@27&' '&@28, 'http_agent="','"') as Alog_http_agent,
TextBetween(@28, 'http_session_id=','') as Alog_http_session_id,
//TextBetween(@32&' '&@33, 'msg="','"') as msg,
//TextBetween(@34, 'srccountry="','"') as srccountry,
//@30&' '&@31&' '&@32&' '&@33&' '&@34 as xxx,
//TextBetween(@31&' '&@32&' '&@33, 'http_retcode="','"') as http_retcode,
TextBetween(@29&' '&@30, 'msg="','"') as Alog_msg,
TextBetween(@30&' '&@31, 'signature_subclass="','"') as Alog_signature_subclass,
TextBetween(@31&' '&@32, 'signature_id="','"') as Alog_signature_id,
TextBetween(@32&' '&@33, 'srccountry="','"') as Alog_srccountry
//TextBetween(@28, 'http_session_id=','') as http_session_id
FROM
[alog-New.csv]
(txt, codepage is 1252, no labels, delimiter is ',', msq)
Where (Alog_Date)>=(Alog_Date) and (Alog_time)>>(Alog_time);
Store alog into alog.qvd;
if some one can help me in this will be really appreciated... thank you in advance
Field name 'Alog_Date' is not found in your qvd. You might try using:
Load * From alog.qvd(qvd);
Note, field name is case sensitive in qv.
The problem is the fact that you are trying to filter csv file by Alog_Date.
FROM
[alog-New.csv]
(txt, codepage is 1252, no labels, delimiter is ',', msq)
Where (Alog_Date)>=(Alog_Date) and (Alog_time)>>(Alog_time);
you don't have this column in your csv file
I see it because TextBetween(@1, 'date=','') as Alog_Date.
The same will be with right(@2,8)as Alog_time.
and I don't understand you Where clause. There is no sence:
Where (Alog_Date)>=(Alog_Date) and (Alog_time)>>(Alog_time);
Hello Shalani,
Is it particularly coming for Alog_Date ? Did you try the qvd with all fields except this date. And as tresesco suggested, try using the '*'.
I would suggest you to first play with data from CSV's, and verify the data at front end. After everything is done, then create a qvd and use it further.
One thing more, are you executing the commented portion first and then other part of script in same QVW? Can you please have a look at Data Model view of the QVW. I feel Qlikview must have merged tables automatically due to same fields.
Thanks,
Angad
As you can see on screenshot the problem appears for concatenation. Not during the load from qvd.