Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kristof_j
Creator III
Creator III

Distinct table isn't distinct after preceding load

Hi

I did something really simple

LOAD  Distinct MonthStart(Date) as month

Resident Orders;

I have now a distinct table with months.

But I wanted to add the previous month. So I did the next thing ...

LOAD  month
,
AddMonths(month,-1) as [month-1];
LOAD  Distinct MonthStart(Date) as month
Resident Orders;

And now my table isn't distinct anymore. It's like QV ignores the first 'Distinct'.

When I add a distinct in the preceding load the table is distinct again

My problem is that there is an impact on efficiency.

Did I do something wrong?

thanks in advance

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You didn't do anything wrong. It's just that the results from the lower load statement are piped directly into the preceding load. That's why the distinct in the lower load statement has no effect.

Btw you can get the result you want like this too:

LOAD  Distinct MonthStart(Date) as month, MonthStart(Date,-1) as [month-1]

Resident Orders;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You didn't do anything wrong. It's just that the results from the lower load statement are piped directly into the preceding load. That's why the distinct in the lower load statement has no effect.

Btw you can get the result you want like this too:

LOAD  Distinct MonthStart(Date) as month, MonthStart(Date,-1) as [month-1]

Resident Orders;


talk is cheap, supply exceeds demand
tresesco
MVP
MVP