Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

QV script throwing error

Hi all,

I am a beginner in QV and I am trying to run a particular script , but it is throwing an error.

I am attaching the error message and the complete script for reference.

Can please someone help me determine the error and how to debug the script.


Regards

Mahendra

5 Replies
sunny_talwar

Try this

[Aircraft Types]:

Map_Manufacturer_Country:
Mapping

LOAD Company,

     Country

FROM [..\Data Files\CSVs\Aircraft_Manufacturers.csv]

(txt, codepage is 1252, embedded labels, delimiter is ';', msq);

[Aircraft Types]:

LOAD AC_TYPEID as [%Aircraft Type ID],

     AC_GROUP as [%Aircraft Group Type],

     SSD_NAME as [Aircraft Name],

     MANUFACTURER as [Aircraft Manufacturer],

     applymap('Map_Manufacturer_Country', MANUFACTURER,'Unknown') as [Aircraft Manufaccturer Country],

     LONG_NAME as [Aircraft Name Full],

     SHORT_NAME as [Aircraft Name Abbreviated],

     BEGIN_DATE as [Aircraft Begin Date],

     END_DATE as [Aircraft End Date]

FROM  [..\Data Files\CSVs\Aircraft_Base_File.csv]

(txt, codepage is 1252, embedded labels, delimiter is ';', msq);

.... and rest of the script can follow as it is


Anonymous
Not applicable
Author

Sunny

Thanks for your prompt response, this really helped.

However I am seeking another guidance from you.

I have a huge number of date values in the format like below:

Jan 1,2017 7:38:08 AM

Jan 2, 2017 7:42:09 AM

Jan 5, 2017 3:01:33 AM

Jan 5 , 2017 3:05:33 AM  and so on

This particular date and time format signifies the time of incidents occurred.

My requirement is only to extract the date in the format "1-Jan-2017", "2-Jan-2017","5-Jan-2017" from the above list of values.

Can you please let me know how can I get it done in the QV script itself if possible?

Also if I use a list box I would want the dates to be displayed as unique dates and not duplicates as per the above example.

Regards
Mahendra

sunny_talwar

If your timestamp is read as timestamp by QlikView... then all you need is one of these

DayName(DateField)

or

Date(Floor(DateField))

If it is read as string, then try this

DayName(TimeStamp#(DateField, 'MMM D, YYYY h:mm:ss TT')) as DateField

or

Date(Floor(TimeStamp#(DateField, 'MMM D, YYYY h:mm:ss TT'))) as DateField

Anonymous
Not applicable
Author

Hi sunny

The first two queries worked partially , it gave me the distinct dates in

the format 1/2/2018, 1/15/2018 etc.

I wanted in the format 15-jan-2018.

The last 2 queries did not work.

Regards

Mahendra

sunny_talwar

Then use this

Date(Floor(DateField), 'DD-MMM-YYYY')