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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Syntax

I have a pie chart that is supposed to break down Passing, Failing and Excluded for the most recent report End Date.

I am using the expression:

count({<P219A_STATUS_C={1},[END DATE]={"=$(Max([END DATE]))"}>}P219A_STATUS_C)

P219A_Status_C:

     1= Passing

     2= Failing

     3= Excluded

The Max(End Date) = 10/28/2013

When I use count({<P219A_STATUS_C={1}>}P219A_STATUS_C)  and select the end date from a list box my results show 63 passing but when I try to include max(Date) in the set analysis my result shows passing as 0

Any ideas on my syntax error?

Thanks

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If END DATE is a date field, you may need:

[END DATE]={"$(=Date(Max([END DATE])))"}

HTH

Jonathan

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

View solution in original post

13 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

If END DATE is a date field, you may need:

[END DATE]={"$(=Date(Max([END DATE])))"}

HTH

Jonathan

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

Thank you that did the trick.  I always have a hard time with dates inside of a set analysis.

Not applicable
Author

Hi Jonathan,  could you help me one more time.  I am using the updated version of the set analysis:

count({1<P219A_STATUS_C={1},[END DATE]={"$(=Date(Max([END DATE])))"}>}P219A_STATUS_C)

However it is not ignoring my selections, do you know why that would happen?

Thanks

swuehl
MVP
MVP

You'll probably need to tell QV that the max([END DATE]) should use the set identifier 1:

count({1<P219A_STATUS_C={1},[END DATE]={"$(=Date(Max({1} [END DATE])))"}>}P219A_STATUS_C)

Not applicable
Author

Hi Jonathan,

I swear I am going crazy.  I was using the expression you helped me with the other day and it was working perfectly.  Overnight our dashboard updated and now it is not working.  My pie charts are displaying 'No data to display'.  I am pretty confident it is not the expression that broke but I was wondering if you have ever run into anything like this and/or had an idea?

Thanks

swuehl
MVP
MVP

Hi Katie,

it might be just coincidential, but we just had a month change.

To investigate why you don't see any data, you can start by creating an expression

count(P219A_STATUS_C)


then select 1 in P219A_STATUS_C and then select today / yesterday in END DATE.

What do you get?

Not applicable
Author

Thanks swuehl,

I have gone through the load script and the set analysis piece by piece and everything seems to be working if I remove that one part of the set analysis.  It also works if I remove that from the set analysis and I use an end date list box to select Max(End Date).

I am just confused as to why an expression would change overnight!

Very Confused!

Can you think of another way to get to the same result.... Max(End Date)?

swuehl
MVP
MVP

Hm, is your END DATE field in fact a timestamp? What do you get by using

=num(max([END DATE]))

in a text box?

Not applicable
Author

I get 41579

?