Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Adding Square Brackets in Load Inline statement

Hi Community,

Is it possible to add square brackets in LoadScript?

Here's my sample code but this throws error "Garbage after statement"

[Code]

Load * Inline [

     Formula, Value

     NetSales, Sum([Net Sales])

];

[/Code]

Any Idea?

Thanks in advance!

Ronald

3 Replies
Anonymous
Not applicable
Author

To my knowledge it is not possible to use square brackets in an inline load. I think you would have to do this in two steps.

raw:

LOAD * Inline [
FIELD1, VALUE
]
;

rich:
LOAD
  FIELD1,
  Sum([VALUE])
Resident raw
Group By FIELD1;

DROP Table raw;

Or, simply don't use spaces in your fieldnames. That way you don't need square brackets.

Not applicable
Author

Hi olafjoppe,

Thanks for the response!

Yes its not possible to add a square brackets I used quotes instead and now its working fine!

Load * Inline [

     Formula, Value

     NetSales, Sum("Net Sales")

];

Regards,

Ronald

Not applicable
Author

How about using variables where the value is set to the expression?

Depending on how you use it you may need to include an aggregation over any chart dimensions.

Regards,

Gordon