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: 
KNRaju105630
Partner - Contributor II
Partner - Contributor II

Group by calculation

Hi Community,

Need help on group by functionality..

I did group by based on Name - if value is the same for Names, I have do add some random number like 0.001

let say, below screen - I have highlighted below 77 amount has two different name. (needs to add 0.001 for one record)

One value should be 77 and another one 77.001... and so on

KNRaju105630_0-1680180663481.png

I did try this, but no luck

 Load *, if(Value=Previous(Value),peek(PreviousValue)+1,Value)

 

 

Labels (1)
1 Reply
marcus_sommer

A check with the interrecord-functions should work whereby it's important to use a properly sorted resident-load  - means applying an order by Value;. If value isn't a native field else the result of a group by aggregation you should do your task within a second load, maybe like:

load *, if(Value = previous(Value), Value + (rowno() / 1000000000), Value) as NewValue
resident Source order by Value;