Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
trying to set a variable with the following expression
Set vYFactor = if(GetSelectedCount([X_Factor.Location])=0, only({<[X_Factor.Location]={"=$(vAverage)"}>}[X_Factor.Storage Paid]), only([X_Factor.Storage Paid]);
when I try to present it in a text box I dont get any value
any idea?
Are you doing this in the script?
You might need to replace $ with something else (#) before and replace # with $ again in the script:
SET vYFactor = Replace('If(GetSelectedCount([X_Factor.Location])=0, only({<[X_Factor.Location]={"=#(vAverage)"}>}[X_Factor.Storage Paid]), only([X_Factor.Storage Paid])', '#', '$');
thank you Sunny..
here is how my two variables looks like now on the script:
set vAverage= '=Average';
SET vYFactor = Replace('If(GetSelectedCount([X_Factor.Location])=0, only({<[X_Factor.Location]={"=#(vAverage)"}>}[X_Factor.Storage Paid]), only([X_Factor.Storage Paid])', '#', '$');
do they look right to you?
Also what should i use inside the text box?
To tell you the truth, I know $() in script variables give problem because they get evaluated. So replace is the solution to get around that, but I have never tried it on my own. I have seen Stefan providing solution to this on various occasions, let me see if I can find one of his responses.
Here check this out:
So try something like this instead:
LET vYFactor = 'If(GetSelectedCount([X_Factor.Location])=0, only({<[X_Factor.Location]={"=$' & '#(vAverage)"}>}[X_Factor.Storage Paid]), only([X_Factor.Storage Paid])', '#', '$')';
i think your solution is fine. the only issue on it is the value inside the set analysis to be 'Average'...
but not sure how I can do that...
What is the Average used for?
just want to pass the value which is 'Average' in set analysis