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

Preeta
New Contributor II

Thank you so much @tlikarish and @Anil !!

Preeta
New Contributor II

Hello,
I used the above functionality to implement RANK also.I am trying to implement the RANK function similar to what we have in sql. Rows with equal values for the ranking criteria should have the same ranks and ranks might not be consecutive numbers. For example, if two rows are ranked 1, the next rank is 3.
I have got the code but its too many snaps and i want to simplify it.
Here is the pipeline and output:
SampleRankJob_2019_09_24 (2).slp (23.5 KB)
key name date rank
ABC Orange 8/1/2018 1
ABC Orange 10/1/2018 7
GEF Apple 10/1/2018 1
GEF Apple 11/1/2018 3