Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

I have a excel sheet with a list of expressions and gave each one a name, now how do i reference that expression in a qvw file? i am doing this:

I have a excel sheet with a list of expressions and gave each one a name, now how do i reference that expression in a qvw file?  i am doing this:

I am doing this =only({1<ExpressionName={Name}>}Expression), how do I get it to convert the expression to actually do the calculation instead of showing the expression

3 Replies
Gysbert_Wassenaar

Try:

=$(=only({1<ExpressionName={'Name'}>}Expression))


talk is cheap, supply exceeds demand
dirk_konings
Creator III
Creator III

I do it like this :

$(=FieldValue('MyField',1))

where MyField is the fieldname in excel and 1 is the first value (expression) in it which you want to use.

expression is like this in excel:

num(sum({<Rubriek = {'MARGE'}, BoekJaar = {$(=max(BoekJaar))}, BoekingsPeriode = {'<=$(=max(BoekingsPeriode))'}>}Waarde)

Dirk

hic
Former Employee
Former Employee

An alternative is to move part of the logic to the script; to create one variable per expression. Then you can refer to the expression directly and your expressions in your objects will become much simpler:

ExpressionList:

Load ExpressionName, Expression From ExpressionList.xls ;

For vExpressionNumber = 0 to NoOfRows('ExpressionList')-1

  Let vExpressionName = Peek('ExpressionName',vExpressionNumber,'ExpressionList');

  Let vExpression = Peek('Expression',vExpressionNumber,'ExpressionList');

  Set $(vExpressionName) = '$(vExpression)';

Next vExpressionNumber

Drop Table ExpressionList;

HIC