Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rittermd
Honored Contributor

Expression Help

What is wrong with this expression?

Sum({<$(vTTLStartDate)={'4/1/2015'}>}((DCrating - AdmitRating) * NumGoal))

/

Sum({<$(vTTLStartDate)={'4/1/2015'}>} NumGoal)

I have confirmed that the variable does contain 4/1/2015.  The variable was created by taking the Min of a date field.

14 Replies
simondachstr
Valued Contributor III

Re: Expression Help

$(vTTLStartDate) has to be a Field within the set modifier - what expression hides beneath the variable?

rittermd
Honored Contributor

Re: Expression Help

min(Date(FromDate))

reddys310
Honored Contributor II

Re: Expression Help

Hi Mark,

Try this:

Sum({<$(=vTTLStartDate)={'4/1/2015'}>}((DCrating - AdmitRating) * NumGoal))

/

Sum({<$(=vTTLStartDate)={'4/1/2015'}>} NumGoal)

rittermd
Honored Contributor

Re: Expression Help

That didn't work. Just get a - in the object

reddys310
Honored Contributor II

Re: Expression Help

may be it could be a conflict with the date formats. Are the formats same?

rittermd
Honored Contributor

Re: Expression Help

I confirmed that the variable displays 4/1/2015

MVP
MVP

Re: Expression Help

May be this:

Sum({<KeyField ={" =$(vTTLStartDate) = '4/1/2015' "}>}((DCrating - AdmitRating) * NumGoal))

/

Sum({<KeyField ={" =$(vTTLStartDate) = '4/1/2015' "}>}} NumGoal)

simondachstr
Valued Contributor III

Re: Expression Help

reddys310‌ this would not work, you need to have a Field on the left hand of the equation within the set modifier.

MVP
MVP

Re: Expression Help

Actually if the variable is getting evaluated to 4/12015, you might be looking to do this:

Sum({<FromDate={'$(=$(vTTLStartDate))'}>}((DCrating - AdmitRating) * NumGoal))

/

Sum({<FromDate={'$(=$(vTTLStartDate))'}>}} NumGoal)