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: 
Not applicable

Conditional statement in Chart expression !!!!

Hi,

I am trying to show the values in the column chart based on a conditional statement. But the expression is not working. Can anyone please help?

Below is the expression that i am using.

Sum({<Date={">=$(DynamicMonthTrend6)"}*{"<=$(=Date(Max(Date)))"}, Quarter=,  [Question]={'Completion Rate'}>}

if([Total Responses]<=30,0,[Total Responses]))

Date={">=$(DynamicMonthTrend6)"}*{"<=$(=Date(Max(Date)))"}: This is defining the time period i.e. months across which columns would be computed i.e "Total Responses".

I want to show sum of "Total Responses" when is >30 else 0 should be shown for that month.

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

the problem is surely related to this part of expression:

Date={">=$(DynamicMonthTrend6)"}*{"<=$(=Date(Max(Date)))"}


if you need a range just do:


Date={">=$(DynamicMonthTrend6)<=$(=Date(Max(Date)))"}

Not applicable
Author

This is also not working.

=Sum({<Date={">=$(DynamicMonthTrend6)<=$(=Date(Max(Date)))"}, Quarter=,  [Question]={'Completion Rate'}>}

if([Total Responses]<=30,0,[Total Responses]))

If i remove the conditional statement and define it as below then it is working fine.

=Sum({<Date={">=$(DynamicMonthTrend6)<=$(=Date(Max(Date)))"}, Quarter=,  [Question]={'Completion Rate'}>}

[Total Responses])

Am i defining the conditional statement correctly?

Not applicable
Author

The problem is that values across all the months are getting changed to 0. Instead i want to change the value only for those month for which it is <=30.

alexandros17
Partner - Champion III
Partner - Champion III

can you post your documetn?

Not applicable
Author

Got it resolved. Actually the data was <30 and also Zero suppressed option was enabled.

Thanks.