Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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;
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;
Now, it's a known fact. Please refer ;Re: Precedent Load vs Resident Load and LOAD DISTINCT and Preceding Loads