Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Flagging duplicates?

Hey,

Need help with a concatenation of three dimensions, Name, Type, and Date and need to flag a duplicate spend record  that corresponds to the concatenation.

Ex:

     Owner - John Doe

     Type - Lodging 

     Date - 6/23/2015

Two records found for $175 dollars with the information above.

5 Replies
Clever_Anjos
Employee
Employee

tmp:

LOAD

     Owner ,

     Type ,

     Date ,

    count(Owner) as qty

resident yourtable;

LEFT join (yourtable)

LOAD

     Owner ,

     Type ,

     Date

    1 as FlgDup

Resident tmp

where qty > 1;

drop table tmp;

MK_QSL
MVP
MVP

Temp:

Load Owner, Type, Date, Owner&Type&Date as Key, Amount From ....

Final:
Load

     *,

     If(Key = Previous(Key) and Amount = Previous(Amount),1,0) as DuplicateFlag

Resident Temp Order By Key, Amount;

Drop Table Temp;

Anonymous
Not applicable
Author

I guess the Amount should be also included in the key in this case.

Not applicable
Author

Ideally, the amount needs to be in the key as well to flag the exact same transaction, but then that brings up another issue as to how to visualize it in a dashboard. This part is saying invalid for me:

tmp:

LOAD

     Owner ,

     Type ,

     Date ,

    count(Owner) as qty

resident yourtable;

Error is invalid expression

Anonymous
Not applicable
Author

See if the attached helps...