Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Community.
Is it possible to declare a variable inside a set analysis?
marked in red what I hope to achieve:
local_variable= 2
sum({<
Calendar_Date={">=$(=weekstart(Date(Max(Calendar_Date)+(7*local_variable))))<=$(=Date(weekstart(Date(Max(Calendar_Date)+(7*local_variable)))+6))"}
,_Employee_FlagTerminated-={1}
,TimeForecastVersion_Name={"Commit"}
,Calendar_WeekOfYear=
,Calendar_YearInt=
>}M_ForecastHours)
Please note that I am aware of the variable declaration in variable overview, but I'm not interested in this solution if possible.
What do you want to achieve with this? Could you explain? Maybe we could come with suggestions by other approaches?
You can parameterize a variable - turning it into something similar to a function? Would that be helpful?
No this is not possible. Variables exist on a global scope in QlikView and they are declared via menus and dialogs or in your load script. You could also declare them via the COM-api and Macros...
What do you want to achieve with this? Could you explain? Maybe we could come with suggestions by other approaches?
You can parameterize a variable - turning it into something similar to a function? Would that be helpful?
Hi Petter.
Thanks for the help - and good to know it's not possible. I guess it would be for rapid replication of expressions, say:
if(sum({<
,_Employee_FlagTerminated-={variable}
>}M_ForecastHours)
/
sum({<
,_Employee_FlagTerminated-={variable}
>}M_UsedHours)>0,
sum({<
,_Employee_FlagTerminated-={variable}
>}M_ForecastHours)
/
sum({<
,_Employee_FlagTerminated-={variable}
>}M_UsedHours))