Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create one table from 2 different tables

Hi

I have 2 tables :

QV_RET_OVED_VW with the columns :

     COMMERCIAL_NUM,

     COMMERCIAL,

     GROUPE_OVED

QV_RET_FAMILLES_VW with the columns :

     COMMERCIAL,

     FAMILLE_NUM

     YEARMONTH

I want to create a table QV_RET_GROUPE_OVED with the columns :

     GROUPE_OVED

     COUNT(FAMILLE_NUM)

That represents the count of FAMILLE_NUM for each GROUP_OVED and by YEARMONTH

I have tried with the expression 'Resident' but it doesn't work

Thank you for your help

Regards

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Just load the tables:

QV_RET_OVED_VW:

Load

    COMMERCIAL_NUM,

    COMMERCIAL,

    GROUPE_OVED

From QV_RET_OVED_VW_source;

QV_RET_FAMILLES_VW

Load:

    COMMERCIAL,

    FAMILLE_NUM,

    YEARMONTH

From ...QV_RET_FAMILLES_VW_source...;

Then in the UI create a new straight table with GROUPE_OVED as dimension and count(FAMILLE_NUM) as expression. That's all you need.

If you feel you need to do it all in the script you'll have to join the tables:

Table1:

Load

    COMMERCIAL_NUM,

    COMMERCIAL,

    GROUPE_OVED

From QV_RET_OVED_VW_source;

join (Table1)

Load:

    COMMERCIAL,

    FAMILLE_NUM,

    YEARMONTH

From ...QV_RET_FAMILLES_VW_source...;

Table2:

Load GROUPE_OVED, count(FAMILLE_NUM) as Count

resident Table1

group by GROUPE_OVED;


talk is cheap, supply exceeds demand

View solution in original post

12 Replies
Gysbert_Wassenaar

Just load the tables:

QV_RET_OVED_VW:

Load

    COMMERCIAL_NUM,

    COMMERCIAL,

    GROUPE_OVED

From QV_RET_OVED_VW_source;

QV_RET_FAMILLES_VW

Load:

    COMMERCIAL,

    FAMILLE_NUM,

    YEARMONTH

From ...QV_RET_FAMILLES_VW_source...;

Then in the UI create a new straight table with GROUPE_OVED as dimension and count(FAMILLE_NUM) as expression. That's all you need.

If you feel you need to do it all in the script you'll have to join the tables:

Table1:

Load

    COMMERCIAL_NUM,

    COMMERCIAL,

    GROUPE_OVED

From QV_RET_OVED_VW_source;

join (Table1)

Load:

    COMMERCIAL,

    FAMILLE_NUM,

    YEARMONTH

From ...QV_RET_FAMILLES_VW_source...;

Table2:

Load GROUPE_OVED, count(FAMILLE_NUM) as Count

resident Table1

group by GROUPE_OVED;


talk is cheap, supply exceeds demand
saumyashah90
Specialist
Specialist

abc:
Left Join(QV_RET_OVED_VW)

Load * resident  QV_RET_FAMILLIES_VW;

Master:

Load GROUPE_OVED,

Count(FAMILLE_NUM) as CountofFAMILLE

resident abc;

Anonymous
Not applicable
Author

Hi

Thanks for your response

But I need a table with the data and not to create a chart

Regards

saumyashah90
Specialist
Specialist

Hey Ankri,

One which i mentioned will make table name Master with that data

Anonymous
Not applicable
Author

Sorry but I don't understand

That is not working

saumyashah90
Specialist
Specialist

See first you load both the tables

Table1:

Load COMMERCIAL_NUM,

COMMERCIAL,

GROUP_OVED

From QV_RET_OVED_VW;

Table2:

Load COMMERCIAL,

FAMILLE_NUM,

YEAR MONTH

FROM QV_RET_FAMILLE_VW;

After this two table get loaded,

Left Join(Table1)

Load * resident Table2;

Drop table Table2;

Master:

Load Group_OVED,

Count(FAMILLE_NUM) as Count_OF_FAMILLE_NUM

resident Table1;

Drop table Table1;

So You will Have Master table fianl consisting of required data

Anonymous
Not applicable
Author

Thank you very much

saumyashah90
Specialist
Specialist

Can you please Mark it correct if it is correct

Anonymous
Not applicable
Author

Hi G WASSENAAR

If I have 3 tables to link, How can I do ?