Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
hitha1512
Creator
Creator

Pick one value among duplicates values

Hello Team,

I have output of data which looks like below. For one date I have 2 tickets giving me value 12 hours time for each, for same baseitem. In such cases where perday per baseitem if i have same values under Time, I should pick only one ticket or show only one value which is 12. 

This needs to be done at backend as I have many scenarios like this.

hitha1512_0-1682321537061.png

Required output: Any one ticket

hitha1512_1-1682321635453.png

Any help would be appreciated.

 

 

Labels (2)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

NoConcatenate
LOAD BaseItem,
DateTest1,
Time,
FirstValue(Number) as Number

Resident SourceTable;
Group By BaseItem,
DateTest1,
Time;
DROP Table SourceTable;

View solution in original post

5 Replies
hic
Former Employee
Former Employee

If you don't use Number as dimension, you will get what you want:

Dimensions:
- Date
- BaseItem

Measures:
- If(Count(Distinct Number)=1,Only(Number),'Several') labelled 'Number'
- Sum(Time)/Count(Distinct Number) labelled 'Time'

hitha1512
Creator
Creator
Author

@hic  Thank you for your quick response 🙂 If i have to apply this at the backend code ? how would that work ?

Since I have multiple charts, I would like this to be done at the backend code level.

I need to pick the first or any row when one baseitem for a particular date has same time values for multiple numbers.

BrunPierre
Partner - Master
Partner - Master

NoConcatenate
LOAD BaseItem,
DateTest1,
Time,
FirstValue(Number) as Number

Resident SourceTable;
Group By BaseItem,
DateTest1,
Time;
DROP Table SourceTable;

hitha1512
Creator
Creator
Author

Thanks a lot. That worked.

Prem0212
Creator
Creator

you can use distinct function in the front end or u can use group by condition in the data load editor and load the script.

 

Please like accept the solution if it is resolved.