Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Syntax error, missing/misplaced FROM....

Hello,

I am trying to Creating dynamc adHOC analysıs in QV by the code written below; but it gives an error, I am missing a point where it is I couldnt find.

ScriptSyntax Error

Set HidePrefix='%';    //Set the Hide Prefix

//Load the list of Dimensions

DimensionList:

LOAD * Inline[

  %Dimensions15

  SalesPerson15

  Country15

  City15

  Product15

];

//load the list of expressions

ExpressionList:

load * Inline [

  %ExpressionName15

  TotalSales15

  OrderCount15

  AvgSales15

  ];

//load the sales data

Data:

LOAD * Inline [

  SalesPerson15, Country15, City15, Product15, Sales15, Orders15   

  Joe, Germany, Berlin, Bricks, 129765, 399   

  Joe, Germany, Berlin, Brogues, 303196, 5842   

  Joe, Germany, Berlin, Widgets, 64358, 1603   

  Joe, Germany, Berlin, Woggles, 120587, 670   

  Joe, Germany, Frankfurt, Bricks, 264009, 2327   

  Joe, Germany, Frankfurt, Brogues, 369565, 3191   

  Joe, Germany, Frankfurt, Widgets, 387441, 5331   

  Joe, Germany, Frankfurt, Woggles, 392757, 735   

  Joe, Germany, Munich, Bricks, 153952, 1937   

  Joe, Germany, Munich, Brogues, 319644, 645   

  Joe, Germany, Munich, Widgets, 47616, 2820   

  Joe, Germany, Munich, Woggles, 105483, 3205   

  Brian, Japan, Osaka, Bricks, 17086, 281   

  Brian, Japan, Osaka, Brogues, 339902, 2872   

  Brian, Japan, Osaka, Widgets, 148935, 1864   

  Brian, Japan, Osaka, Woggles, 142033, 2085   

  Brian, Japan, Tokyo, Bricks, 161972, 1707   

  Brian, Japan, Tokyo, Brogues, 387405, 2992   

  Brian, Japan, Tokyo, Widgets, 270573, 3212   

  Brian, Japan, Tokyo, Woggles, 134713, 5522   

  Brian, Japan, Yokohama, Bricks, 147943, 4595   

  Brian, Japan, Yokohama, Brogues, 405429, 6844   

  Brian, Japan, Yokohama, Widgets, 266462, 3158   

  Brian, Japan, Yokohama, Woggles, 477315, 5802   

  Joe, UK, Birmingham, Bricks, 23150, 1754   

  Joe, UK, Birmingham, Brogues, 200568, 1763   

  Joe, UK, Birmingham, Widgets, 262824, 617   

  Joe, UK, Birmingham, Woggles, 173118, 5359   

  Joe, UK, London, Bricks, 621409, 712   

  Joe, UK, London, Brogues, 504268, 2873   

  Joe, UK, London, Widgets, 260335, 1313   

  Joe, UK, London, Woggles, 344435, 743   

  Joe, UK, Manchester, Bricks, 401928, 1661   

  Joe, UK, Manchester, Brogues, 7366, 2530   

  Joe, UK, Manchester, Widgets, 6108, 5106   

  Joe, UK, Manchester, Woggles, 269611, 4344  

  Mary, USA, Boston, Bricks, 442658, 3374   

  Mary, USA, Boston, Brogues, 147127, 3129   

  Mary, USA, Boston, Widgets, 213802, 1604   

  Mary, USA, Boston, Woggles, 395072, 1157

  Michael, USA, Dallas, Bricks, 499805, 3378   

  Michael, USA, Dallas, Brogues, 354623, 18   

  Michael, USA, Dallas, Widgets, 422612, 2130   

  Michael, USA, Dallas, Woggles, 217603, 2612   

  Mary, USA, New York, Bricks, 313600, 6468   

  Mary, USA, New York, Brogues, 559745, 1743   

  Mary, USA, New York, Widgets, 94558, 2910   

  Mary, USA, New York, Woggles, 482012, 3173   

  Michael, USA, San Diego, Bricks, 95594, 4214   

  Michael, USA, San Diego, Brogues, 24639, 3337   

  Michael, USA, San Diego, Widgets, 107683, 5257   

  Michael, USA, San Diego, Woggles, 221065, 5058

  ]

  ;

Syntax error, missing/misplaced FROM:

DimensionList:

LOAD * Inline[

                %Dimensions15

                SalesPerson15

                Country15

                City15

                Product15

]

DimensionList:

LOAD * Inline[

                %Dimensions15

                SalesPerson15

                Country15

                City15

                Product15

]

1 Solution

Accepted Solutions
maxgro
MVP
MVP

add a space after inline to

LOAD * Inline[

it should be

LOAD * Inline [

View solution in original post

10 Replies
maxgro
MVP
MVP

add a space after inline to

LOAD * Inline[

it should be

LOAD * Inline [

satishkurra
Specialist II
Specialist II

Simple

There should be space between Inline and opening [ bracket

To avoid the above problem, do the below

Edit Script > Insert Menu > Load Statement > Load Inline

By doing above you will not get syntax errors in this case

Thanks

Not applicable
Author

Thank you so much, but there is still a problem on the chart side.

The chart says; "All expressions disabled" although I apply the all steps correctly.

15- Sales Analysis.PNG

Not applicable
Author

also the steps,I applied;

These steps show you how to create dynamic ad hoc analysis in QlikView:

  1. Open the Select Fields tab of the sheet properties. Select on the Show System Fields option (so you can see the hidden fields). Add a list box on the display for  the %Dimensions and %ExpressionName fields.
  2. Create a new bar chart.
  3. Set the title of the chart to Sales Analysis. Turn on Fast Type Change for Bar Chart, Pie Chart, Straight Table, and Block Chart. Click on Next.
  4. Add the four dimensions – Country, City, Product, and SalesPerson. For  each dimension, turn on Enable Condition and set the following expressions  for each of them:

Dimension

Expression

Country

=Alt(  WildMatch(    GetFieldSelections(%Dimensions, '|'),     '*Country*') ,0)

City

=Alt(  WildMatch(    GetFieldSelections(%Dimensions, '|'),     '*City*') ,0)

Product

=Alt(  WildMatch(    GetFieldSelections(%Dimensions, '|'),     '*Product*') ,0)

SalesPerson

=Alt(  WildMatch(    GetFieldSelections(%Dimensions, '|'),     '*SalesPerson*') ,0)

               

  1. Add the following three expressions and set Conditional on each of them:

Expression

Conditional Expression

Sum(Sales)

=Alt( WildMatch( GetFieldSelections( %ExpressionName, '|'),    '*Total Sales*') , 0)

Sum(Orders)

=Alt( WildMatch( GetFieldSelections( %ExpressionName, '|'), '*Order Count*') , 0)

Sum(Sales)/ Sum(Orders)

=Alt( WildMatch( GetFieldSelections( %ExpressionName, '|'),    '*Avg. Sales*') , 0)

  1. On the Style tab, set the orientation to Horizontal. 7. On the Presentation tab, turn on the Enable X-Axis Scrollbar option and set When Number of Items Exceeds to 8. 8. On the Layout tab, deselect the Size to Data option.
  2. On the Caption tab, turn off the Allow Minimize and Allow Maximize options. Click on Finish.
  3. Add a list box for the four main dimensions. Add a container object for the four list boxes. Add a Current Selections box.
  4. Lay the objects out for ease of use.
maxgro
MVP
MVP

your dimension field is %Dimension15; in the expression you used %Dimension, not the same field

The value is Country15, in the expression you used Country

DimensionList:

LOAD * Inline[

  %Dimensions15

  SalesPerson15

  Country15

  City15

  Product15

];

=Alt(  WildMatch(    GetFieldSelections(%Dimensions, '|'),    '*Country*') ,0)




the same for expressions


ExpressionList:

load * Inline [

  %ExpressionName15

  TotalSales15

  OrderCount15

  AvgSales15

  ];

=Alt( WildMatch( GetFieldSelections( %ExpressionName, '|'),    '*Total Sales*') , 0)

Not applicable
Author

No sorry, It is copy from the book (originally) but I re-named the fields, ın my scipt all are the same name as you said.

maxgro
MVP
MVP

try the attachment

Not applicable
Author

This one is easy. When I tried the simple one  similar to yours, it run as well. The one,on the attachment, I tried to do is more complex for me,

I attached the QV document that I tried,

Could you please check the chart?

Please let me know where I do a mistake.

maxgro
MVP
MVP

see attachment for chart 15 - Sales Analysis

In the conditional expression TotalSales, not Total Sales

In the conditional dimension Country15 not Country

1.png