However, I have run into an issue where I have a need for a variable to be loaded based on the value of another variable. Let me explain what I mean.
Lets assume I have these two variables:
vMedClaim = 1;
vDrillNo = IF($(vMedClaim) = 1, '<250',250);
What I want to occur, during the script refresh, is for vDrillNo to either be '<250' or 250 as determined by the vMedClaim variable. However when I follow the method outlined in Barry's blog, the full expression is stored as the value of vDrillNo even though I am using the LET command.
Thanks for the continued effort here (from both of you). I really appreciate the assistance.
Sunny, adding the "=" to the variable in the excel file certainly resolves the issue, but I am concerned this will cause performance degradation as I have read that having the "=" in the variable causes it to be reevaluated with every click. I have a few variables to apply this kind of logic to.
Taking this approach came me some weird numbers for the dollars, but what I realized was I think I can get away with your previous suggestion (using the equal sign in the stored variable). As it turns out, I only need to store the equal sign for variables that are going to be used in set analysis as the other ones seem to evaluate the expression without issue.
I also didnt, need to use the double quotes around in the set analysis. It seemed to work either way, but is it best practice to use them?
I have run into a snag using the double-quotes and it could just be how I am trying to combine everything.
Let me explain further.
Essentially this thread was to help me set a default value to vDrilldownSvcCat to avoid using sheet triggers. And that part works great and the charts all work as expected now (with the double-quotes). The issue comes in that I have several buttons that change the value assigned to vDrilldownSvcCat to just 250 or <250.
Once the value goes from the expression to just the <250 or 250 the double-quotes interfere with the set analysis and no results are displayed.
*Single quotes would work if I was only returning a literal but in the case of <250 I dont think single quotes will work.
So, are you saying that you have an over-arching double quotes within which you have another set of double quotes? The reason I ask this is because in the attached sample I made >250 and 250 both worked within the double quotes... but in your real scenario it isn't? What is the difference?
As part of the variable load I am assigning a value to vDrilldownSvcCat to =If($(vMedClaims) = 1,'<250','250). So in the app the value is exactly as I outlined.
I then have buttons in the app that change the value of vDrilldownSvcCat to just 250 or just <250. Because in the application the user needs to be able to change the values but I needed to default the application into a certain value and that is the reason for the formula in the initial formula.