Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a problem trying to insert a variable into a static table, then try to evaluate its value in runtime, but I keep getting errors.
Here's the scenario:
Step 1- Load a tatic table with the dynamic value
StaticTable:
NOCONCATENATE
LOAD * INLINE [
DimDef, "IF($(var1)=0, 1, 0)"
];
Step 2 - Use the field's value as a Calculated Dimension Expression:
$(=DimDef)
Result:
When I Load the data, the expression of the column is evaluated prior setting the dimension definition, and the static table's row has the following:
StaticTable:
DimDef
"IF(1=0)=0, 1, 0"
So, the value neves changes, since the variable was evaluated at load time, not in at "chart time"
I tried to play around with this approach and replacing the quotes but didnt worked:
http://community.qlik.com/message/59213#59213
Any Suggestion so I can enter "IF($(var1)=0, 1, 0)" in my static table and it goes untouched to my chart's calculated dimmension, so at the end, the expression will be calculated in runtime?
Thanks in advance for the time
-ed
You could try something like this:
load
'$' & DimDef as DimDef
inline [
DimDef
(var1)
];
but that's much less readable than an external file.
As far as I can tell there's no way to turn off dollar sign expansion in the load scripts. For variables, you can use the replacement trick you referenced but for inline tables the only workaround I've found is to convert the inline table to a csv or excel file and load it from the file instead.
Hi vhuynh, thanks for your recomendation, it look like you were trying to achieve the same some time ago, was the external file the only solution that you got this working?
I mentioned it to our lead and he didn't like to much the idea of having external files, this is why I am trying to get it to work somehow.
thanks again for your time.
-Ed
You could try something like this:
load
'$' & DimDef as DimDef
inline [
DimDef
(var1)
];
but that's much less readable than an external file.
Sure! I'll try it right now
Thanks a lot, it worked like a charm, great solution, now I can use dynamic functions as Calculated Dimmensions.
-ed