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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Duplicate Items are coming ?

HI All,


I am getting Duplicate Items are coming for some Invoice Numbers , how to correct getting a unique invoice Number ?


Thanks,

Helen

5 Replies
tresesco
MVP
MVP

Try DISTINCT keyword, like:

LOAD Distinct *  From <> ;

OR,

Use EXISTS() function like:

Load

          Invoice, A, B

From <> Where Exists(Invoice) ;

ashwanin
Specialist
Specialist

If only you are extracting the invoice numbers then use Distinct function for unique invoice number.

sunilkumarqv
Specialist II
Specialist II

Hi helen,


In script make you filed name as like below reload and check

(DISTINCT [Invoice]) as Invovice


let me know any changes




sunilkumarqv
Specialist II
Specialist II

Count distinct "Count( Distinct <Field Name>)" is an expensive expresssion in Qlikview. Whenever used, it turns Qlikview to use single core instead of multi-cores resulting in slow performance of the app.
By making a small change in data model we can replace COUNT DISSTINCT with SUM function and improve the app performance marginally and increase app response time to users actions.

To achive this add another field in Qlikview table having value 1 along with the field you need to count.

Example:

Bookings:

LOAD

    [Member Id],

    [Booked Date],

    [Transaction Id],

    [Booking Amount]

FROM Bookings.qvd (qvd);


"Member Count":
LOAD
    [Member Id],
    1 AS "Unique Members"
Resident Bookings;

To count distinct members
COUNT(DISTINCT [Member Id]) can be replaced with SUM([Unique Members]).

tresesco
MVP
MVP

Sunil,

Probably, it's no more single threaded/cored, please have a look here: http://community.qlik.com/blogs/qlikviewdesignblog/2013/10/22/a-myth-about-countdistinct

Hoping it is similar at script as well.