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: 
Spasupuleti1641121123
Contributor II
Contributor II

data aggregation

Hi All,

Please help me on below scenario,

input table:

0695b00000Rgur9AAB.png 

output Table:

0695b00000Rguu2AAB.png 

for out table i need to add extra column Wos_fc,

if inv_qty>=net_sale_quantity then value for wos_fc = 0

else if inv_qty <

net_sale_quantity then i need to calculate sum (inv_qty) till value should reach the net_sale_quantity.

example:

net_sale_quantity=110 and inv_qty=110 then wos_fc=0

if net_sale_quantity=110 and inv_qty=55 then value should be calculated as sum(55+10)=60

60<110 so again

sum(55+10+60)=125

now 125>110 ---> so wos_fc=3 (3 becz sumation on three rows to reach condition.

similar for remining rows..

i need to achive this with talend , kindly help me..

Thanks,

sudheer

 

Labels (3)
1 Solution

Accepted Solutions
Spasupuleti1641121123
Contributor II
Contributor II
Author

Hi gjeremy1617088143 ,

Thank you so much for helping me , i will try to understand your answer let you know output..

Thank you so much..

View solution in original post

6 Replies
gjeremy1617088143
Creator III
Creator III

Hi @SUDHEER pasupuleti​ , you could try something like this

you read your file and you use a tFlowToIterate to make a single flow for each value:

then you use a Tmap to join with the same file and get all the values with date >= to your entry date for eg :

if your input is 21 may you will have :

21 may

28 may

4 jun

11 jun

then you can use a tJavaFlex on the output of the tMap to make a for loop with your conditions

gjeremy1617088143
Creator III
Creator III

I use tFixedFLowInput 1 and 3 to simulate your file

0695b00000RhbaFAAR.png0695b00000RhbaAAAR.png0695b00000RhbYUAAZ.png0695b00000Rhba0AAB.png0695b00000RhbZvAAJ.png0695b00000RhbZqAAJ.png0695b00000RhbZlAAJ.png0695b00000RhbYAAAZ.png0695b00000RhbZRAAZ.png

Spasupuleti1641121123
Contributor II
Contributor II
Author

Hi gjeremy1617088143 ,

Thank you so much for helping me , i will try to understand your answer let you know output..

Thank you so much..

Spasupuleti1641121123
Contributor II
Contributor II
Author

Hi gjeremy,

could please share whole java code in java flex component, i am not able to see that, kindky help me

gjeremy1617088143
Creator III
Creator III

Hi @SUDHEER pasupuleti​ , there is the full code in the picture, just a the end the last } is cropped by the component window.

Spasupuleti1641121123
Contributor II
Contributor II
Author

ok, i will check properly.. thank you so much for reply.