cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Can We create a Variable in Mapper

Karan_Mhatre
New Contributor II

Hello Everyone,

I am trying to create an incremental addition let say i have 2 columns empl_id and salary so in target i want to derive third column with cumulative salary.

I can do it by using variable, have done it using Different tool but never implemented it in snaplogic

Hence the question can we create Variable in mapper?

any help is appreciated

21 REPLIES 21

Anil
New Contributor III

Hi @Karan_Mhatre, @bhupender.singh

Please find the solution for the above usecase without using the script snap.

The attached pipeline solves your purpose.
variableInMapper_2019_07_24.slp (9.1 KB)

image

Karan_Mhatre
New Contributor II

Hello Anil,

Really appreciate your effort to find a solution, But i think there is wrong calculation done for cumulative salary.

Can you please check your logic again , please refer to my expected o/p comment?

Thank you again for showing us a way!

Anil
New Contributor III

Hi @Karan_Mhatre,

Yeah the logic was not right,

Please find the latest attached pipeline which solves your requirement.
image

variableInMapper_2019_07_29.slp (9.6 KB)

tlikarish
Employee
Employee

If youโ€™re not finding any of the specialized snaps are fitting your use case, you could try the Script snap to implement the transformation in JavaScrip/Python/Ruby. Hope you can find something that solves your problem.

bhupender_singh
New Contributor III

@Karan_Mhatre
@tlikarish
I have wrote down a script to fulfill your request, please refer to attached pipeline and screenshot.
image
test_2019_07_19.slp (11.0 KB)