Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
farolito20
Contributor III
Contributor III

add a column to qvd

I have a qvd with this columns

id,name,age

but I add a new column, and I need to assign null() to old data without this value in this column

id,name,age,city

How to know which rows don't have a column?

13 Replies
Not applicable

Dear farolito20,

if i understand your question correctly,

 

if you want to add a cloumn to the existing QVD file

as you said the qvd contains id,name,age.

i think you want to add City column with Null value.

then

you need to write like in the script.

Null() as CIty.

Thanks,

Mukram.

farolito20
Contributor III
Contributor III
Author

Yes, but this work in the first load. What about the next? if a add rows with a value in city, this will be null()

farolito20
Contributor III
Contributor III
Author

I need to identify wich rows don't have the city columns

Anonymous
Not applicable

Rebuild the QVD and then save again.

TheQVD:

LOAD

    ID,

    Name,

    Age,

    If(Len(City)>0,City,Null()) AS City

FROM TheQVD.qvd (qvd);

STORE TheQVD INTO TheQVD.qvd;

This should overwrite the existing one.

Jonathan

Not applicable

Dear farolito20,

you mean you want to find which rows have Null values?

If possible can you post your QVW file.

Thanks,

mukram.

farolito20
Contributor III
Contributor III
Author

Ok, but if not exist this give an error, qv not found city

farolito20
Contributor III
Contributor III
Author

I need which rows not have this columns. If one row not have t_seak put null, else t_seak

Not applicable

Dear farolito20,

write the below script before loading your table.

as you said if one row not have t_seak value it will keep NULL as value in that row.

Map_Nulls:

Mapping LOAD

NULL(),'NULL'

AutoGenerate 1;

MAP * using Map_Nulls;

i hope it will help you.

else post the sample file.

Thanks,

Mukram.

farolito20
Contributor III
Contributor III
Author

DimOld:

          LOAD

                    %KeyCustomer,

                    t_bpid,

                    t_nama,

                    t_seak,

                    t_ccur,

                    ValidFrom,

                    ValidTill,

                    MostRecent,

                    Autonumberhash256(t_bpid,t_nama,t_seak,t_ccur)          as Checksum

                    FROM DimCustomers_Day0.qvd (qvd);

but in the first load, old rows not have t_seak column, so when I load this, I have an error becuase qv not found the t_seak.