Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
bruno_m_santos
Partner - Creator
Partner - Creator

Evaluate String as Expression

Good morning,

I'm trying to evaluate a string in a Pivot Table as an Expression, but it's not working...

if

(len(Expression1)<>0, Expression1, Sum($(vSetMTD) #Amount))

Expression1:

(aggr( sum(TOTAL $(vSetMTD_2Intersect)* <[Report Name]={'DRBI'},[Report LineNr]={'A25'} >}  #Amount),[Report LineNr])*-0.30)

If I copy the cell value and paste as an Exporession, it works.

Could you help me please.

Thanks

Bruno

4 Replies
Gysbert_Wassenaar

Maybe like this: if(len(Expression1)<>0, $(Expression1), Sum($(vSetMTD) #Amount))

Edit: it would help if you posted a sample document


talk is cheap, supply exceeds demand
bruno_m_santos
Partner - Creator
Partner - Creator
Author

Returns nothing.

Bruno

anandathome
Creator
Creator

Hi Bruno,

     I am not sure where you have stored the Expression1.

My suggestion would be (if you have not done already)

1. Create Expression1 as variable in Load script like

SET Expression1='(aggr( sum(TOTAL $(vSetMTD_2Intersect)* <[Report Name]={'DRBI'},[Report LineNr]={'A25'} >} Amount),[Report LineNr])*-0.30)'

2. Then your expression should be

if(len(Expression1)<>0, $(Expression1), Sum($(vSetMTD) #Amount))

-Anand.

bruno_m_santos
Partner - Creator
Partner - Creator
Author

Hi Anand

It’s stored at Report Line Level.

I pretend to evaluate to each line, if an custom formula exists, if not, I want to use an general formula)

Thanks

Bruno