Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello !
I need to use a combination of Preceeding Load (the load that reprocess the previous load) and CROSSTABLE.
Syntax is this :
VSQSE:
LOAD
*
,MID(QUESTAO_VSQSE,2) AS QUESTAO_VSQSE;
CROSSTABLE (QUESTAO_VSQSE,RESPOSTA_VSQSE,4)
LOAD
RECNO_VSQSE
,AAAAPP_VSQSE
,AAAAPP_VSQSE & '/' & INSCRI_VSQSE AS INSCRI_KEY
,INSCRI_VSQSE
,QUESTAOX_1_VSQSE
,QUESTAOX_2_VSQSE
,QUESTAOX_3_VSQSE
,QUESTAOX_4_VSQSE
,QUESTAOX_5_VSQSE
,QUESTAOX_6_VSQSE
,QUESTAOX_7_VSQSE
,QUESTAOX_8_VSQSE
,QUESTAOX_9_VSQSE
,QUESTAOX_10_VSQSE
,QUESTAOX_11_VSQSE
,QUESTAOX_12_VSQSE
,QUESTAOX_13_VSQSE
,QUESTAOX_14_VSQSE
,QUESTAOX_15_VSQSE
,QUESTAOX_16_VSQSE
,QUESTAOX_17_VSQSE
,QUESTAOX_18_VSQSE
,QUESTAOX_19_VSQSE
,QUESTAOX_20_VSQSE
,QUESTAOX_21_VSQSE
,QUESTAOX_22_VSQSE
,QUESTAOX_23_VSQSE
,QUESTAOX_24_VSQSE
,QUESTAOX_25_VSQSE
,QUESTAOX_26_VSQSE
,QUESTAOX_27_VSQSE
,QUESTAOX_28_VSQSE
,QUESTAOX_29_VSQSE
,QUESTAOX_30_VSQSE
,QUESTAOX_31_VSQSE
,QUESTAOX_32_VSQSE
,QUESTAOX_33_VSQSE
,QUESTAOX_34_VSQSE
,QUESTAOX_35_VSQSE
,QUESTAOX_36_VSQSE
,QUESTAOX_37_VSQSE
,QUESTAOX_38_VSQSE
,QUESTAOX_39_VSQSE
,QUESTAOX_40_VSQSE
FROM $(ARQUIVO) (QVD);
It's not working. I mean , invalid syntax.
May I do that ? What's the syntax ?
Thanks !
BTW I wanna "filter" the number inside the word QUESTAOX_##_VSQSE . I want to keep just the number between the underscores.
Thanks !
Hi, AFAIK the preceding load feature doesn't work with crosstables (i don't know the reason :P), i've tried with a resident
check this out:
DATA1:
CROSSTABLE(QUESTAO, RESPOSTA)
LOAD CODE,
QUESTAOX_1_VSQSE,
QUESTAOX_2_VSQSE,
QUESTAOX_3_VSQSE,
QUESTAOX_4_VSQSE,
QUESTAOX_5_VSQSE
FROM test_crosstable.xls (biff, embedded labels, table is Sheet1$);
DATA:
Load
CODE,
QUESTAO,
textbetween(QUESTAO,'_','_') as Number,
RESPOSTA
resident DATA1;
drop table DATA1;
rgds & good luck
Hi, AFAIK the preceding load feature doesn't work with crosstables (i don't know the reason :P), i've tried with a resident
check this out:
DATA1:
CROSSTABLE(QUESTAO, RESPOSTA)
LOAD CODE,
QUESTAOX_1_VSQSE,
QUESTAOX_2_VSQSE,
QUESTAOX_3_VSQSE,
QUESTAOX_4_VSQSE,
QUESTAOX_5_VSQSE
FROM test_crosstable.xls (biff, embedded labels, table is Sheet1$);
DATA:
Load
CODE,
QUESTAO,
textbetween(QUESTAO,'_','_') as Number,
RESPOSTA
resident DATA1;
drop table DATA1;
rgds & good luck
First of all, if you just want the number in the middle of QUESTA0X, I would make those values in a field called QUESTA0X. Then this should work:
VSQSE:
CROSSTABLE (QUESTAO_VSQSE,RESPOSTA_VSQSE,4)
LOAD
RECNO_VSQSE
,AAAAPP_VSQSE
,AAAAPP_VSQSE & '/' & INSCRI_VSQSE AS INSCRI_KEY
,INSCRI_VSQSE
,QUESTAOX
FROM $(ARQUIVO) (QVD);
Regards,
Now I have ANOTHER problem !
The field REPOSTA (wich means ANSWER) may have those contents :
A
B
C
D
and, it may be mixed, such as
A C
A B D
and so forth.
I need to separate thos mixed situations into SEPARATE records !
Difficult ?
hi, use the subfield function without the 3rd parameter
Subfield(REPOSTA,' ') as REPOSTA_2
the separator is space (i think xD)
rgds