Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

"Connect" two fields from 2 different tabels

Lets say I have one table with

ID,

Date,

something else,

and another with

ID,

Tons,

something else(2),

How would i use the Date and Tons to calculate how many tons i have for a specific date

1 Solution

Accepted Solutions
qlikviewwizard
Master II
Master II

Hi,

Try like this.

DATA_EMP:

LOAD ID,

    // date(DATE#(Date,'MM/DD/YYYY')) as Date,

    Date,

    S1,

    S2

FROM

TEST_DATA.xlsx

(ooxml, embedded labels, table is Sheet1);

JOIN (DATA_EMP)

LOAD ID,

    Tons,

    S3,

    S4

FROM

TEST_DATA.xlsx

(ooxml, embedded labels, table is Sheet2);

NoConcatenate

DATA:

LOAD *, if(Date=Today(),Tons) as Today_Tons;

LOAD * Resident DATA_EMP;

DROP TABLE DATA_EMP;

Capture.PNG

View solution in original post

7 Replies
vishsaggi
Champion III
Champion III

Qlikview should automatically join both the tables based on common field ID. Can you show your data model and expr your are trying?

Anonymous
Not applicable
Author

They have the line in between them but I just want to know what an expression like that would look like?

Anonymous
Not applicable
Author

I need to Sum all of the tons for dates that are today.

Anonymous
Not applicable
Author

so like IF(date = Today(), Sum(tons_actual))

vishsaggi
Champion III
Champion III

Ok. So is your Date field same format as Today() format? What is the issue you are facing. Any sample file to look into?

May be you can try like

= Sum(IF(Date = Today(), tons_actual)

Anonymous
Not applicable
Author

=IF(Date(date_arrivee, 'dd/mm/yyyy') < Date(today(), 'dd/mm/yyyy'), Sum(tons_actual))

qlikviewwizard
Master II
Master II

Hi,

Try like this.

DATA_EMP:

LOAD ID,

    // date(DATE#(Date,'MM/DD/YYYY')) as Date,

    Date,

    S1,

    S2

FROM

TEST_DATA.xlsx

(ooxml, embedded labels, table is Sheet1);

JOIN (DATA_EMP)

LOAD ID,

    Tons,

    S3,

    S4

FROM

TEST_DATA.xlsx

(ooxml, embedded labels, table is Sheet2);

NoConcatenate

DATA:

LOAD *, if(Date=Today(),Tons) as Today_Tons;

LOAD * Resident DATA_EMP;

DROP TABLE DATA_EMP;

Capture.PNG