Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

kristof_j
Contributor II

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

Tags (1)
1 Solution

Accepted Solutions

Re: Distinct table isn't distinct after preceding load

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
2 Replies

Re: Distinct table isn't distinct after preceding load

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
MVP
MVP

Re: Distinct table isn't distinct after preceding load

Community Browser