Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
chris1987
Contributor

Concatenate WHERE NOT EXISTS()

Hi,

I have the following code which works exactly how I want it to, but when I reload the code again, I get the information duplicated. I think I need to put a "WHERE NOT EXISTS" statement in but I can't figure out how to do this.

Here's the code:

TrackerTemp:

LOAD *

FROM

(qvd);

Concatenate(TrackerTemp)

/*Not Made - Due*/

LOAD *,

    'ukOpenOrdersNot_MadeDue'  & num(today()) & 'UD' as [ID],

    'uk' as Database,

    'UD' as Entity,

    today() as Date,

    'OpenOrders' as AppName,

    'Not Made' as FieldName,

    'Due' as FieldType,   

    sum(if([Status]='Due' and [Category]='Not Made',[Value To Make],'Not Found')) as [Value]

Resident CustTable;

So I load TrackerTemp, then I get the new information from CustTable and it concatenates the two, but if I get run it again I get duplicate entries.

Thanks

Chris

Tags (2)
1 Solution

Accepted Solutions
viveknair1234
New Contributor III

Re: Concatenate WHERE NOT EXISTS()

You just need to add distinct after your load statement, I would really recommend you to go through the below link so that you can understand the whole functionality

http://www.qlikfix.com/2013/07/30/distinct-can-be-deceiving/

4 Replies
viveknair1234
New Contributor III

Re: Concatenate WHERE NOT EXISTS()

Why don't you use Distinct?

chris1987
Contributor

Re: Concatenate WHERE NOT EXISTS()

Could you give me an example please? I've never used DISTINCT before, not in QV anyway

Cheers

Chris

viveknair1234
New Contributor III

Re: Concatenate WHERE NOT EXISTS()

You just need to add distinct after your load statement, I would really recommend you to go through the below link so that you can understand the whole functionality

http://www.qlikfix.com/2013/07/30/distinct-can-be-deceiving/

chris1987
Contributor

Re: Concatenate WHERE NOT EXISTS()

Brilliant. Great read. I always thought the LOAD DISTINCT only apply to the information it was loading - not to the resulting table. This worked perfectly.

Cheers

Chris