Discussion Board for collaboration related to QlikView App Development.
I am trying to write a script to meaures the number saves a service rep gets, for which they receive credit 60 days later. So if the rep has a save in March he would receive credit for it in May. Any clue on how to write that in the script.
I have attached my script for reference. I appreciate all the help.
You could calculate the date the rep gets credit via dateadd functions. This could be done by either adding months or days to your save date value. This adds 60 days to the date: date(DateFieldName + 60, 'MM/DD/YYYY').
What I am essentially trying to do when ever someone has a save, to look two months back. For example, in april, an agent would receive credit for the saves they had in feb. I loaded an inline table to correlate the yearmonth to look at two months back. I am not sure how to apply that to my master table. I am not sure if this this is a good approach.
I have attached the file for your reference.
Mapping Load * INLINE
I think the approach of having the inline map will be cumbersome for you to maintain as time goes on. If you load the data from your script (I assume the 'Date' field is the date of the "Save") and calculate the date the rep receives credit things will be much easier. I have attached an example.
If you want to maintain your mapping load, this is the syntax to join it to your data:
applymap('SavesMap', Year(Date) & '-' & Month(Date), 'Not Mapped') as FieldName
In an applymap statement, you need the mapping you are applying, the field you are mapping to, and (optionally) a value for the un-mapped values from the field. In this instance, "Not Mapped" will appear if the mapping load does not contain a Month-Year combo found in the data set.