Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
inputtable:
LOAD *, previous(sales) as prev-----------why should i write this statement here only, my doubt is we have not yet defined sales.
INLINE [
sales----------here only we are defining pls explain me
123
153
1456
235
845
365
896
486
];
outputtable:
LOAD sales,
Peek(sales,3,'inputtable') as peek
Resident inputtable;
It is not a top down reading. Take a look at Resident Load:
outputtable:
LOAD sales,
Peek(sales,3,'inputtable') as peek
Resident inputtable;
The table it is reading from is last, this is where it tells it to get the data, in inputtable. Then it performs the necessary calculations.
Same for the first Load you have.
inputtable:
LOAD *, previous(sales) as prev
INLINE [
sales
123
153
1456
235
845
365
896
486
];
So it is getting the info from the INLINE first, then doing the calculations.
Have you tested it out yourself in your script?
Hope this helps!
s result is ok .previous we can use with in the load statement or outside .if u have any example like this pls send me thanks in advance
extract from here
hope it helps you
The basic syntax is:
LOAD * INLINE [
Field1, Field2, Field3
Value11, Value21, Value31
Value12, Value22, Value32
…
];
Please notice that:
- You may enter as many fields as you want
- The field names of the table or the star (*), the functions are before INLINE and the brackets ([]): the names are the one of the target table
- The field names are also just after the open bracket ([) first line: the names are the one of the data source
- The fields and values are separated with a comma (,) but the end of line has no comma
You may:
- Replace the [] with double quotes (").
- Use a function to format the fields before the INLINE statement
- Rename the input fields
- Use several times a single input
Example:
Temp:
Load
Field1,
Date(Date#(Field2, 'DD-MM-YYYY')) as Field2,
Field3,,
Field4
Inline [
Field1,Field2,Field3,Field4
A, 01-01-2013, 200, 100
B, 01-01-2013, 100,300
C, 01-01-2013, 300,400
A, 02-02-2013, 0,500
];
As you see with this example, the field names appear twice. We use a function to format the date but the other 3 fields are not
modified.
Please notice that:
- The names of the columns of the table (Col1 …) and those of the source (NomCol1 …) are not necessarily the same: you
can rename all or some of them
- The number of columns may also be different: an input field may be used several times to compute several columns
Manoj,
It is confusing. It is called Preceding load. You add a load statement before the Inline, even though sales is not defined, and ending that load statement with a semi colon. No FROM or RESIDENT. It will then later be "filled up" by your Inline, or any other load. A bit upside down, but Henric Cronström explains the concept quite clearly here.
http://community.qlik.com/blogs/qlikviewdesignblog/2013/03/04/preceding-load
Christian