Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Data Selection

Hi Everyone,

i have two data sources.

The first one contains our company's total output. Each Product is saved in it's own row. Columns are date, serial number and product type.

The second source contains all defective products. Also with one row per product and the columns date, serial number and product type.

Goal is the creation of a graphic, which shows the percentage of errors over the time.

So far no challenge. Unfortunately the total output data is being created automatically. The Error list is being created manually with delay.

To be sure of having a representative error rate, only values with the same max date may by considered.

Can you propose any solution?

Thanks in advance!

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Or if you want to filter on Max Date already when the script runs:

Defective:
Load
Date,
SerialNumber,
ProductType
from Defective ... ;

MinMaxDate:
Load Min(Date) as MinDate, Max(Date) as MaxDate resident Defective ;
Let vMinDate = num(floor(peek('MinDate', -1, 'MinMaxDate')));
Let vMaxDate = num(floor(peek('MaxDate', -1, 'MinMaxDate')));
Drop Table MinMaxDate;

Total:
Load
Date,
SerialNumber,
ProductType
from Total (txt)
where Date >= $(vMinDate) and Date <= $(vMaxDate) ;

View solution in original post

3 Replies
Not applicable
Author

Hi,

I'd generate the source data with a timestamp for each new row. Put the timestamp dates in a list box, so that the user can filter on last date. You might also use an input box with a variable vMaxDate.

You can also use set analysis to solve this issue. In general, the solution will depend on flagging (timestamp) the source data in both sources.

Maybe, this general description gives you an idea?

Rgds,

sebablum

hic
Former Employee
Former Employee

Or if you want to filter on Max Date already when the script runs:

Defective:
Load
Date,
SerialNumber,
ProductType
from Defective ... ;

MinMaxDate:
Load Min(Date) as MinDate, Max(Date) as MaxDate resident Defective ;
Let vMinDate = num(floor(peek('MinDate', -1, 'MinMaxDate')));
Let vMaxDate = num(floor(peek('MaxDate', -1, 'MinMaxDate')));
Drop Table MinMaxDate;

Total:
Load
Date,
SerialNumber,
ProductType
from Total (txt)
where Date >= $(vMinDate) and Date <= $(vMaxDate) ;

Not applicable
Author

Thanks Henric, this is the kind of solution i was looking for!