Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

How to handle single quotes in Inline Load

I've searched all over the community and have tried different tactics but I can't get this one to work.  The simple inline table below, it's failing due to the single quotes in the "F2" field.  I need those single quotes though.  I've tried different combo's of using double quotes, single quotes, chr(39), [] ... can't figure this out.  I know it's possible.  Can somebody help?  Thanks for anything

Example:

LOAD * INLINE [

    F1, F2

    Actuals, sum({$<[Source Name]
= {'Current View'}>}[Outlook Units])

];

1 Solution

Accepted Solutions

Re: How to handle single quotes in Inline Load

You can enclose field names in [ ], ` `, ´ ´ and " " pairs. So try it like this:

LOAD * INLINE [

    F1, F2

    Actuals, sum({$<"Source Name" = {'Current View'}>}"Outlook Units")

];

Or if you have no double quotes in your expressions try:

LOAD * INLINE "

    F1, F2

    Actuals, sum({$<[Source Name] = {'Current View'}>}[Outlook Units])

";


talk is cheap, supply exceeds demand
7 Replies
Not applicable

Re: How to handle single quotes in Inline Load

Hi Dc,

I think inline load will not support expresions like this

sum({$<[Source Name] = {'Current View'}>}[Outlook Units])

you used setanalysis here. it will support like date(today(),'MMM YY') but here you were using filter condition.

Regards,

Chandra

sivarajs
Valued Contributor II

Re: How to handle single quotes in Inline Load

I guess because of square bracket([) in expression creating error because we usually end inline table with ]

So remove that and try

LOAD * INLINE [

    F1, F2

    Actuals, sum({$<Source Name = {'Current View'}>}Outlook Units)

];

Re: How to handle single quotes in Inline Load

You can enclose field names in [ ], ` `, ´ ´ and " " pairs. So try it like this:

LOAD * INLINE [

    F1, F2

    Actuals, sum({$<"Source Name" = {'Current View'}>}"Outlook Units")

];

Or if you have no double quotes in your expressions try:

LOAD * INLINE "

    F1, F2

    Actuals, sum({$<[Source Name] = {'Current View'}>}[Outlook Units])

";


talk is cheap, supply exceeds demand

Re: How to handle single quotes in Inline Load

HI

Change the Source Name as SourceName or Source_Name and for OutlookUnits. You can give label as Source Name as in front end.

Then

LOAD * INLINE [

    F1, F2

    Actuals, sum({$<SourceName
= {'Current View'}>}OutlookUnits)

];

Not applicable

Re: How to handle single quotes in Inline Load

Thank all of you for your quick responses, all of you had different solutions to fix the problem but for me Gysberts explanation and solution was the most effecient.  I learned a lot about characters ([ ],",') and how Qlikview handles them with this question which will help me in different areas.

Thanks again

Not applicable

Re: How to handle single quotes in Inline Load

I wish I would have asked this in my original post.  Now that I have my inline table filled out I am attempting
to use it in my pivot table for dynamic sorting of my expressions.  So for example if they select F1 of "Actuals"
my set analysis value of sum({$<[Source Name] = {'Current View'}>}[Outlook Units]) would be executed and expressions
dynamically sorted.  It's a cool trick I use for sorting pivot tables, I usually use buttons with variables but
in this case I have so many it would look nicer if I allowed the users to select F1 values using a list box.

So my second question is:

How do I force Qlikview to actually execute the value of F2 in the pivot table vs the literal text?  For variables
the $() is used but it looks like this doesn't work for table values?  Any suggestions?

Thanks again

jeffmartins
Contributor II

Re: How to handle single quotes in Inline Load

Hi dcbonnet,

The expressions in fields can be evaluated using a variable, but it´s possible to use several expressions in field creating a variable with all expressions.

See the following link and the attached file for more detail.  http://community.qlik.com/thread/67420

Regards

Community Browser