Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
markp201
Creator III
Creator 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
ogster1974
Partner - Master II
Partner - Master II

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.

View solution in original post

3 Replies
ogster1974
Partner - Master II
Partner - Master II

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
Creator III
Creator III
Author

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
Partner - Master II
Partner - Master II

Yes would do the same thing.