Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I have a large amount of variables I wish to define in the load script. I have done so like this
//Rank Retrieval
//Full Sales Force
SET vCalculateDayTakenRank=Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank);
SET vCalculateWeekTakenRank=Only({$<SalesRep>}LineHistory_TakenRanking.WeekTakenRank);
SET vCalculateLastWeekTakenRank=Only({$<SalesRep>}LineHistory_TakenRanking.LastWeekTakenRank);
SET vCalculateMonthTakenRank=Only({$<SalesRep>}LineHistory_TakenRanking.MonthTakenRank);
followed by many more.
These variables work when added one by one in variable overview.
In the load script I cannot add the = required to initialise the code.
I have chosen to define them in my load script because of the large number and because I need to copy this structure into a number of other applications.
Things that I have tried so far:
SET vCalculateDayTakenRank==Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank);
SET vCalculateDayTakenRank='=Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank)';
SET vCalculateDayTakenRank=[=Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank)];
SET vCalculateDayTakenRank="=Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank)";
SET vCalculateDayTakenRank="'=Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank)'";
Set should work just as well. Try
SET vCalculateDayTakenRank = =Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank);
with a space between the two equals signs.
HIC
Try LET instead of SET when you use delimiters for the string.
Does this force the variable to contain a static value upon reload?
I want to be able to calculate the result whenever I call the variable because SalesRep is not a static selection
Hi Joshua, I used your double quotes option and seems worked:
From:
SET vCalculateDayTakenRank="=Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank)";
Created this variable:
Sum of your tried options should work. Like:
SET vCalculateDayTakenRank='=Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank)';
seems to be fine. Try =vCalculateDayTakenRank in a text box. Doesn't it give your expected output? Could you post a sample qvw that shows the issue you are talking about?
Set should work just as well. Try
SET vCalculateDayTakenRank = =Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank);
with a space between the two equals signs.
HIC
The Set works fine, I use it all the time, but you need a space between the two = sign.
SET vCalculateDayTakenRank= =Only({$<SalesRep>}LineHistory_TakenRanking.DayTakenRank);
Hey Ruben,
I tried your method and it did indeed work this time. Perhaps I had not tried double quotes properly.
It was returning a null in my sample text box when an integer was expected.
I think I may have accidentally forgot to reset the SalesRep selection upon reload though
Thanks henric, out of all of these I think this is the easiest option (I have a good few variables written already so this should be easy to do via find and replace)