Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I have managed to load data from our SQL server into Qlikview by:
ODBC CONNECT32................................
SQL
SELECT a,b,c FROM TABLE1
;
Then later on I would like to create a few new fields using:
LOAD *;
IF(MATCH(a,'Apples'),'FRUIT','VEGETABLE') as GROCERY_MARKER;
This last line of code does not give me the newly created GROCERY_MARKER among my field list.
So two questions:
1.Should my SQL be under a LOAD command (I know Qlikview does it by default) and the result to be defined by a Table name?
ie.
ODBC CONNECT32................................
GROCERY_Tbl:
LOAD *;
SQL
SELECT a,b,c FROM TABLE1
;
2. How can I get this new field to appear on my field list? I believe it might be related to the first question, as I might need to define my table to refer to it on question 2.
Thanks for your help and patience,
Aksel
hello
you should code it in this way
odbc ...
grocery_tbl:
load *,
IF(MATCH(a,'Apples'),'FRUIT','VEGETABLE') as GROCERY_MARKER;
sql
select ....
;
and your new field will appear with the others
hello
you should code it in this way
odbc ...
grocery_tbl:
load *,
IF(MATCH(a,'Apples'),'FRUIT','VEGETABLE') as GROCERY_MARKER;
sql
select ....
;
and your new field will appear with the others
Does this mean that every time I add a new field after my load line, I need to rerun the whole SQL? or can I just run that bit on its own?
Thanks for quick come back.
you can also run your sql once and store the result in a qvd file
then load your data from this qvd and add additional fields
Thank you.