Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
bobbydave
Contributor III

Creating an empty table that will eventually populate.

I have a table below. This loops around and picks up a number of countries and stores them

I have one country that will have a blank table for now but over the next coming weeks, it will populate. I want to put in a catch so that right now,

if the table for LU is blank, store the LU table as blank so that the QVD is still created. Because it is empty at the moment, the table hasn't created. Is there a way to do this?

E_Tia_CLAIM_QUESTION_WIZ:
LOAD
"COUNTRY_CODE",
"CLAIM_NO",
"Q81";
SQL SELECT '$(country_code)' COUNTRY_CODE , CQW.*
FROM
"MI_$(country_code)_DBA"."CLAIMS_Q_WIZARD" CQW;


STORE E_Tia_CLAIM_QUESTION_WIZ into $(vQVDs)\E_Tia_CLAIM_QUESTION_WIZ_$(country_code).QVD;
DROP Table E_Tia_CLAIM_QUESTION_WIZ;

Tags (3)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: Creating an empty table that will eventually populate.

Ha David Whelton,

Just create an empty inline table:

E_Tia_CLAIM_QUESTION_WIZ:

LOAD * INLINE [

COUNTRY_CODE, CLAIM_NO, Q81

];

CONCATENATE (E_Tia_CLAIM_QUESTION_WIZ)
LOAD
"COUNTRY_CODE",
"CLAIM_NO",
"Q81";
SQL SELECT '$(country_code)' COUNTRY_CODE , CQW.*
FROM
"MI_$(country_code)_DBA"."CLAIMS_Q_WIZARD" CQW;

In this case you will always have the table, but when there is no date the table will be empty.

2 Replies
Highlighted
Partner
Partner

Re: Creating an empty table that will eventually populate.

Ha David Whelton,

Just create an empty inline table:

E_Tia_CLAIM_QUESTION_WIZ:

LOAD * INLINE [

COUNTRY_CODE, CLAIM_NO, Q81

];

CONCATENATE (E_Tia_CLAIM_QUESTION_WIZ)
LOAD
"COUNTRY_CODE",
"CLAIM_NO",
"Q81";
SQL SELECT '$(country_code)' COUNTRY_CODE , CQW.*
FROM
"MI_$(country_code)_DBA"."CLAIMS_Q_WIZARD" CQW;

In this case you will always have the table, but when there is no date the table will be empty.

Re: Creating an empty table that will eventually populate.

Indeed, I frequently use

LOAD * INLINE [

Field1

];

Where "Field1" is at least one of the fields coming from the source, and then concatenating. It's also easier to CONCATENATE when working with loads in loops.