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

If Statement with Set Analysis

I am trying to use the following set analysis, but I am getting incorrect results. The first If statement should return 4 rows that do not meet that criteria. If I run the 1st if statement separately I do get the 4 rows I expect. But when I runs this whole expression everyone is coming out as true. Not sure what I have incorrect. Thank you.

 

IF

(SUM(
{<
FLG_PRIMARY_CARE = {1},
FLG_ADMIT = {1},
MonthsDifference=P(Months),
MonthStart=P(ISLAND_CAL_DT.Date),
FLG_LAST_CONTACT_DT = {1}
>}
DTAP
)
>= 4

AND

SUM(
{<
FLG_PRIMARY_CARE = {1},
FLG_ADMIT = {1},
MonthsDifference=P(Months),
MonthStart=P(ISLAND_CAL_DT.Date),
FLG_LAST_CONTACT_DT = {1}
>}
HEPB


)
>= 3,0,1)

3 Replies
Sasja
Contributor II
Contributor II

Sorry for my question, but have you figured out what the problem was yet?

I am having a similar problem.

I just have the feeling that an 'If' statement containing an aggregation does not go well together. Maybe someone here on this forum can clarify this?

 

BrunPierre
Partner - Master
Partner - Master

@Sasja And what is the specific challenge?

Sasja
Contributor II
Contributor II

I'm not sure how to explain it, but I'll see if I can clarify the problem.

We have a worksheet with a table containing values. These values ​​are determined by means of an 'If' statement in which it is checked whether an average value of a number of measurements is sufficient.

This seems to work correctly.

Now my colleague and I also have an almost identical 'If' statement with average calculation where we associate the value with a color for the background of the field in the table.

This changes either the value we put in the field or the background color does not match the value.

Even when I determine the background color in a completely different way (for example by 'If ( 1=1,..)' or 'If( 1=2, ..) ) the value displayed in the field also changes.

How is that possible?