Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I'm currently trying to get a document into SVN via QlikView's integrated SVN support and through my research, I found that variables entered into the Variables tab of the Document Properties Dialog will not persist in source control so my first step was to move all of my variables to my script (best practice anyway) and reload to make sure everything came through as expected.
Things looked great until I got to a variable in which set analysis and dollar sign expansion were used. Here's what I I'm dealing with:
So it looks to me like instead of pulling my variable value through like it did with other variables I have using functions, it did the dollar sign expansion and nothing else.
Any ideas on what I need to do in the script to get my variable value to end up like it is in (1) above? Any input would be greatly appreciated because I need to get this project into source control but cannot do so if I'm going to lose these variable values.
Thanks!
See qvw example attached.
It might be because of using the $() within the double quotes (what normally works fine)
In this case try it with single quotes like here:
SET vPlanYear_Current_Employee_Months_temp = "Sum({<EnrollmentDate_SD1 = {'>=$(vPlanYear_CurrentStart)'}, ClmPdDt_MonthYear=, IncurFromDt_MonthYear=, EnrollmentStatus={'Employee'}>}[Medically Eligible Month])";
Nothing, ay?
Try a pair of single quotes around your dollar expansion.
=Sum({<EnrollmentDate_SD1 = {">='$(#vPlanYear_CurrentStart)'"}, ClmPdDt_MonthYear=, IncurFromDt_MonthYear=, EnrollmentStatus={'Employee'} >}[Medically Eligible Month])
I think the dollar sign will always cause trouble when you set the variables in the script. I used a replace function therefore and a 2-step-approach for each variable...this should work
SET vVariable_tmp = "sum(~(x))";
SET vVariable = "=Replace(vVariable_tmp, '~', '$')";
Thanks for the suggestion. Unfortunately, it had no effect.
I changed my code as suggested to:
SET vPlanYear_Current_Employee_Months_temp = "Sum({<EnrollmentDate_SD1 = {">=~(#vPlanYear_CurrentStart)"}, ClmPdDt_MonthYear=, IncurFromDt_MonthYear=, EnrollmentStatus={'Employee'}>}[Medically Eligible Month])";
SET vPlanYear_Current_Employee_Months = "=Replace(vPlanYear_Current_Employee_Months_temp, '~', '$')";
This netted me a variable with the value of:
=Replace(vPlanYear_Current_Employee_Months_temp, '~', '$')
If I use this variable in a text object, I just get the text:
"Sum({<EnrollmentDate_SD1 = {">=$(#vPlanYear_CurrentStart)"}, ClmPdDt_MonthYear=, IncurFromDt_MonthYear=, EnrollmentStatus={'Employee'}>}[Medically Eligible Month])"
I also tried using LET in place of SET in the second line and that netted me an empty variable.
Did you use the expression in the textbox like that: =$(vPlanYear_Current_Employee_Months) ?
Yes, that's what yielded me the expression as text.
See qvw example attached.
It might be because of using the $() within the double quotes (what normally works fine)
In this case try it with single quotes like here:
SET vPlanYear_Current_Employee_Months_temp = "Sum({<EnrollmentDate_SD1 = {'>=$(vPlanYear_CurrentStart)'}, ClmPdDt_MonthYear=, IncurFromDt_MonthYear=, EnrollmentStatus={'Employee'}>}[Medically Eligible Month])";
That did it! Thank you so much for the assistance.
That's a bit of a PITA but at least it gets the job done and gets my doc into source control which is a HUGE deal.