Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

variable error in expression

Hi,

Please help me figure out what is wrong with my variable in this expression. It just returns null.

=count({<[Decision Date]={$(vYesterdayApp)}>}[Decision Result])

This is my variable:

vYesterdayApp = max([Decision Date])

When I create a text obect with just the variable value I get 2013/01/07, which is correct.

19 Replies
khadeer
Specialist
Specialist

Try this

=count({<[Decision Date]={"$(vYesterdayApp)"}>}[Decision Result])

gerhardl
Creator II
Creator II
Author

Hi,

Tried that - it returns 0

khadeer
Specialist
Specialist

I hope there is no problem , what u written in set analysis,.... check ur dates, both have same formats r nt.if its r correct format

try this

By pass ur year fields n month fields

=count({<[Decision Date]={"$(vYesterdayApp)"},Year=,Month=>}[Decision Result])

gerhardl
Creator II
Creator II
Author

Which "both" are you referring to? There is only one date used in this expression.

When I do a text object I get 2013/01/07.

When I put that in my expression I get the correct answer:

=count({<[Decision Date]={'2013/01/07'}>}[Decision Result])

adamwilson
Partner - Creator
Partner - Creator

try this:

=count({<[Decision Date]={ "$(=vYesterdayApp)" }>}[Decision Result])

gerhardl
Creator II
Creator II
Author

Hi,

I did try that, also doesn't work.

The moment the variable is between quotes QV doesn't see it as a variable.

adamwilson
Partner - Creator
Partner - Creator

I think this might work this time:

=count({<[Decision Date]={ "= $(=vYesterdayApp)" }>}[Decision Result])

gerhardl
Creator II
Creator II
Author

Afraid not.

That gives me the same answer as

=count({<[Decision Date]={*}>}[Decision Result])

or just

count([Decision Result])

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

The set expression uses the text form of dates. Max(....) returns a number rather than a date. So this might work:

=count({<[Decision Date] = {"=$(=Date(vYesterdayApp))"}>} [Decision Result])

This assumes Decision Date is in the default date format (in Set DateFormat = ....).

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein