Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
According to the Qlikview documentation the load statement can use a previously loaded field as a data source. Suggestion is that this can be very useful when reading from web pages.
Can someone give a practical example of this use as I can't get my head round why I'd want to be able to do this.
Many thanks
Do you refer to "preceding load"?
This would be like
LOAD
Cost;
LOAD
Value * Price AS Cost,
*;
LOAD
Field1AS Value,
Field2 AS Cost
FROM .....
Thus you are able to use fieldnames or calculation-results. Read order is from bottom to top, i.e. topmost is the latest calculation at the bottom you find typically the direct loading from the source.
HTH
Peter
Hi Peter,
Thank you for this but I don't think preceding load is what I mean, though I could be mistaken.
"Load from field
The load statement may now use a previously loaded QlikView field as data source. This feature can be quite useful e.g. when reading data from web pages."
Example in the manual is -Loading data from previously loaded fields
Load A from_field (Characters, Types);
Gray
Hi,
Attached a qvw file for from_field.
Check if it helps you.
Hi,
Your example shows me how to use the statement - below is how I would normally achieve the same result
second:
LOAD two AS ttwo
RESIDENT first
where len(two) > 5;
What I'm trying to understand is what benefit FROM_FIELD offers?
Hello. Any chance someone could post the actual script code provided in the qvw example. I'm learning how to use Qlikview using the personal edition and the example won't open it that. Cheers and many thanks.
Regards
Graham
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='Rs. #,##0.00;Rs. -#,##0.00';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='DD-MM-YYYY';
SET TimestampFormat='DD-MM-YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
first:
LOAD * INLINE [
one, two
1, 1
2, 22
3, 333
4, 4444
5, 55555
6, 666666
7, 7777777
8, 888888
9, 99999
10, 10101010
11, 111111
12, 1212
13, 13
14, 1414
15, 151515
];
second:
LOAD @1 as ttwo
FROM_FIELD
(first, two)
(txt, utf8, explicit labels, delimiter is '\t', msq)
where len(@1) > 5;
Hi Licquor,
do you know the benefits of from_field by now?
I still don't and I came up with exactly the same lines of code to simulate the results of the given "from_field" example as you 🙂
Kind regards
Chris
Hi,
now I found out what can be done with "load * FROM_FIELD"!
If you have a datasource which contains more than 1 value in a field, then you can load the different values directly as colums or rows into a new table !
Example:
Table Filter:
Application IP_Filter
xyz 192.168.0.1, 192.168.0.5, 192.168.1.13
LOAD @1, @2, @3 FROM_FIELD (Filter, IP_Filter) (no labels);
Results in Table
@1 @2 @3
192.168.0.1 192.168.0.5 192.168.1.13
===================================================================================
Alternatively you can use a filter to transpose the resulting table.
LOAD @1 FROM_FIELD (Filter, IP_Filter) (no labels, filters(Transpose()));
Results in Table
@1
192.168.0.1
192.168.0.5
192.168.1.13
===================================================================================
(Note that you need the "labels" parameter. I does not make any differences if you use "no labels" or "embedded labels", but omitting the parameter will result in an error message!
Hi hundkatzemaus,
I keep getting an error "Cannot open file" probably because of the wrong format specifier. Can you please tell me which specifier do i need to use in the following case ?
DateDim:
Load
DateId
From
DateDim.qvd;
AllDates:
LOAD
@1 AS AllDateIds
FROM_FIELD
(DateDim, DateId)
(embedded labels);