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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
navaneeth79
Contributor II
Contributor II

Removing Duplication?

Hi everyone,

I successfully removed duplication using group by but when I add date field I am getting duplication, how to remove the duplications in this case?

thanks in advance.

20 Replies
navaneeth79
Contributor II
Contributor II
Author

you mean max(date(floor(datefield)))

shraddha_g
Partner - Master III
Partner - Master III

yes

navaneeth79
Contributor II
Contributor II
Author

duplicates are reflecting, for better understanding I will give example

ID      DATE           TIME   Priority     Service

A       25/07/2017   100         3             XYZ

A       26/07/2017      0          3             XYZ

A       27/07/2017     10         3             XYZ

B       26/07/2017     150       3             ABC

B      28/07/2017        0         3             ABC

I want the output as

ID      DATE          TIME    Priority    Service

A      27/07/2017      110     3              XYZ

B      28/07/2017       150    3               ABC

shraddha_g
Partner - Master III
Partner - Master III

Load

ID,

Max(DATE) as DATE,

sum(TIME) as TIME,

Priority,

Service

From Table

group by ID,

               Priority,

               Service;

navaneeth79
Contributor II
Contributor II
Author

Hi Shraddha,

I did the same but getting duplicates

shraddha_g
Partner - Master III
Partner - Master III

then it will be better if you share your sample app

navaneeth79
Contributor II
Contributor II
Author

can youu help me again qvw application to your reply

PrashantSangle

Hi,

Can you provide your sample app???

also mention from where you want to achieve it i.e. from front end or in script..

If you want it in script then logic suggested by shraddha.g‌ must work, you have to modify it as per your requirement.

Or if you want in front end then take straight table

take ID as dimension

and expression

1:max(date)

2: sum(time)

3: max(Priority)

4: Only(Service)

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Kushal_Chawda

try this

Data:

LOAD * Inline [

ID,      DATE,          TIME,  Priority,    Service

A,      25/07/2017,  100,        3 ,            XYZ

A,      26/07/2017,      0 ,        3 ,            XYZ

A,      27/07/2017,    10 ,        3,            XYZ

B,      26/07/2017,    150,      3 ,            ABC

B,      28/07/2017,        0,        3 ,            ABC ];

Inner Join(Data)

LOAD ID,

    sum(TIME) as TimeNew,

    max(DATE) as DATE

Resident Data

Group by ID;

drop field TIME;


rename field TimeNew to TIME;

Note: Replace inline table with your actual data table

navaneeth79
Contributor II
Contributor II
Author

thanks for the solution its working fine but a small issue in it, for particular ID two dates are same so how to get only one from it