Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load command in script syntax

I am pulling all fields from a table in Access, and I tried to add a Load command to the script to create an additional field.

The table has Code1, Code2, etc. thru Code6, and if any of these begins with an "M" I want a boolean field to be True.

QlikScript.bmp

When I run this script I get the fields from the table, but not the additional field Flagged.  Can anyone tell me what I need to add? I could do it in the Access table first, but I'd like to learn how to do it here, since this field would be used for a chart.

Labels (1)
1 Solution

Accepted Solutions
MayilVahanan
MVP
MVP

Hi

Use 'True' as string like this.

For ex:

Load *,if(left(Code2,1)='M','True');

Select * from tablename;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

8 Replies
Not applicable
Author

Hi,

Put the load statement on top of the select statement.

change it so it will look as follows:

Load *,  //that way you load all data from the SQL statement

       if(.........) AS flagged;

Select *

from 'table'   ;

Goodluck

Not applicable
Author

It still doesn’t like it.  It’s a syntax problem - it’s looking for True as a field, not as a value.  Field not found - <True>

Not applicable
Author

It still doesn’t like it.  It’s a syntax problem - it’s looking for True as a field, not as a value.  Field not found - True

Not applicable
Author

It still doesn’t like it.  It’s a syntax problem - it’s looking for True as a field, not as a value.  Field not found - True

MayilVahanan
MVP
MVP

Hi

Use 'True' as string like this.

For ex:

Load *,if(left(Code2,1)='M','True');

Select * from tablename;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

You can use it with 'True' so it will be a string or either put 1 instead,

If (condition,1, else..)

Hilla Peled

ב-14 בדצמ 2012, בשעה 00:24, "Bill Ritzel" <qcwebmaster@qlik.com<mailto:qcwebmaster@qlik.com>> כתב/ה:

QlikCommunity<http://community.qlik.com/index.jspa>

Re: Load command in script syntax

created by Bill Ritzel<http://community.qlik.com/people/billritz> in New to QlikView - View the full discussion<http://community.qlik.com/message/291492#291492>

Not applicable
Author

Worked! Thanks.

Bill Ritzel

Reliability Data Analyst

Allegiant Travel Company

8360 S. Durango Drive, Las Vegas, NV 89113

Direct: 702-589-8062 | Ext: 3641 Bill.Ritzel@allegiantair.com<mailto:Bill.Ritzel@allegiantair.com> | www.allegiant.com<http://www.allegiant.com/>

MayilVahanan
MVP
MVP

HI

Please close the post by marked as assumed answer or correct answer, it helps others to know the answer for similar issue.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.