Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Ciao,
credo sia una domanda abbastanza semplice, ma non riesco a risovere il mio problema.
Io carico da file excel i dati con il seguente script:
LOAD *FROM
C:\....dati.xlsx
(
ooxml, embedded labels);In questo file è presente un campo DATA con formato tipo AAAAMMGG.
Vorrei creare un campo aggiuntivo "ANNO" con il solo anno. Credo sia necessaria la funzione left.
Come posso modificare il mio script?
Grazie mille
ciao Marco,
due possibilités
quando qlikview videre el campo DATA como tipo Date possere scrivere
load
year(DATA) as Anno
from ...;
quando qv non videre el campo DATA como tipo Data ma como tipo Texto possere scrivere
load
mid(DATA,1,4) as Anno
from ...;
esperiamo ti assistenza!
Ok, Grazie!!
Io pero voglio importare tutti i campi e anche il campo Anno.
Se nella parte Modifica Script scrivo:
load *, mid(DATA,1,4) as Anno
from ...;
Non funziona!
Grazie per la risposta
Hi,
it would be nice, if you use this forum only in english!
Marco,
I have to see your qvw to understand the issue. Can you post it ?
The load command should have worked - did you try as it looks below?
LOAD * ,
mid(DATA,1,4) as Anno
FROM C:\....dati.xlsx (ooxml, embedded labels);
Sorry Martina..
Yes this is my problem.
The load command that you write, work for all variables of my database...but not for variable DATA. The correct name is DATA PASS. SOFF. (it's important)
The Variable DATA PASS. SOFF. my be have the same name of an other default variable (DATA). I can't change that name.
So if i use your command for other varibles like NAME, ADDRESS correctly it returns the first 4 letters or numbers, but if i try to use the MID function for the variable DATA PASS. SOFF. it doesn't work.
Error message:
Error in expression:
')' expected
LOAD *, mid(data pass. soff., 4,1)
FROM
C:\....work.xlsx
(ooxml, embedded labels)
Thank you
hi,
it would be easier if you attach an example qvw to your message.
The issue may e wit th ename of your field. The field name contains spaces and special characters so putting square brackets around the name may help You shoudl also use the renaming like below
OldfiedlName as NewFieldName
Try this
LOAD *,
mid([data pass. soff.], 1,4) as Anno
FROM
C:\....work.xlsx
(ooxml, embedded labels)
if you still have an issue try and post your qvw. that will make it easier to help you.
Ok, it's perfect!
Thank you PatAgen. Grazie mille!!
finalmente!
Tutto è bene quel che finisce bene