Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

markp201
Contributor III

What will this do?

Someone handed me this.  What I can see is.

1. Ordered_mobile_base = all rows from mobile_base but only matches from mobile_latest_id.

What does the where clause do for the last table?  I've never seen a syntax like even with SQL.

Why even do the first table if you just want the lastrow?

All referenced table and fields exist.

[Ordered_mobile_base]:

NOCONCATENATE

LOAD

  *

RESIDENT mobile_base;

LEFT JOIN

LOAD

  vin,

  mobile_lastrow

RESIDENT

  [mobile_latest_id]

;

DROP TABLE [mobile_base];

Drop Table [mobile_latest_id];

//find the latest records of inspex data

[latest_mobile_base]:

NOCONCATENATE

LOAD

  *

RESIDENT

  [Ordered_mobile_base]

WHERE

  mobile_lastrow=mobile_recno

;

Drop Table [Ordered_mobile_base];

1 Solution

Accepted Solutions
Highlighted
ogster1974
Honored Contributor II

Re: What will this do?

The first step joins a table of data with the id of the latest record from a latest record identification table so you have a mix of old and new records in the resulting dataset

The second step returns only the data for just the latest records.

The where clause compares one field in the table with the other and where it matches it brings it through in the results.  

Pretty standard SQL.

3 Replies
Highlighted
ogster1974
Honored Contributor II

Re: What will this do?

The first step joins a table of data with the id of the latest record from a latest record identification table so you have a mix of old and new records in the resulting dataset

The second step returns only the data for just the latest records.

The where clause compares one field in the table with the other and where it matches it brings it through in the results.  

Pretty standard SQL.

markp201
Contributor III

Re: What will this do?

Usually in Qlik we used the EXISTS function to filter in/out the matches and with fewer steps.

This seemed a little round-about method but I understand.

ogster1974
Honored Contributor II

Re: What will this do?

Yes would do the same thing. 

Community Browser