Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression

Could somebody let me know what is wrong in this expression, I receive always NULL.

Thanks

1 Solution

Accepted Solutions
pgrenier
Partner
Partner

Hello Joaquin,

Based on your current data model and chart configuration, it seems that if the above condition is true, then the response would be 1, otherwise, you would get a 0.

Would it be satisfactory for you to simplify your expression to:

If(Sum ({<FISCALCY={"$(=max( FISCALCY))"}   >} REGSLSRTL) <>0, 0, 1)

Regards,

Philippe

View solution in original post

17 Replies
pgrenier
Partner
Partner

Hello Joaquin

I believe the double quote characters are missing:

Count(if (Sum ({<FISCALCY={"$(=max( FISCALCY))"}   >} REGSLSRTL) <>0  ,'', CURSKN))


Regards,


Philippe

Not applicable
Author

I have the same results. NULL.

simondachstr
Luminary Alumni
Luminary Alumni

Try Count(if (Sum ({<FISCALCY={'$(=max( FISCALCY))'}   >} REGSLSRTL) <>0  ,'', CURSKN))

Not applicable
Author

Attached is the QVW

Not applicable
Author

I have the same result NULL

De: Martin Mahler

Enviado el: lunes, 21 de abril de 2014 17:37

Para: Salmerón, Joaquín

Asunto: Re: - Expression

Qlik Community<http://community.qlik.com/>

Expression

reply from Martin Mahler<http://community.qlik.com/people/mahlerma?et=watches.email.thread> in App Development - View the full discussion<http://community.qlik.com/message/512617?et=watches.email.thread#512617>

tresesco
MVP
MVP

Couple of issues:

  • If we need to use one(in your case sum()) aggregation function in another(count()) one, we have to use AGGR().
  • It seems that you want to count CURSKN when sum()=0 against each SKN (your dimension), and SKN and CURSKN seem to be same. So you would always get 1 if the condition satisfies. Do yuo really want that?
Not applicable
Author

Sorry, My dimension is also CURSKN and I want to count CURSKN when SUM expression is not zero

De: tresesco

Enviado el: lunes, 21 de abril de 2014 17:58

Para: Salmerón, Joaquín

Asunto: Re: - Expression

Qlik Community<http://community.qlik.com/>

Expression

reply from tresesco<http://community.qlik.com/people/tresesco?et=watches.email.thread> in App Development - View the full discussion<http://community.qlik.com/message/512644?et=watches.email.thread#512644>

pgrenier
Partner
Partner

Hello Joaquin,

Based on your current data model and chart configuration, it seems that if the above condition is true, then the response would be 1, otherwise, you would get a 0.

Would it be satisfactory for you to simplify your expression to:

If(Sum ({<FISCALCY={"$(=max( FISCALCY))"}   >} REGSLSRTL) <>0, 0, 1)

Regards,

Philippe

View solution in original post

pgrenier
Partner
Partner

Joaquin,

Using your chart in the supplied QVW, I created the following expression that I named REGSLSRTL_Sum

Sum ({<FISCALCY={"$(=max( FISCALCY))"}   >} REGSLSRTL)

Then I created this new expression:

If(REGSLSRTL_Sum<>0, Count(CURSKN))

This expression displays either 1 or Null based on whether the retail sales for the current fiscal year are different than 0 or not. If you wish, you map opt to hide the column using the "Hide Column" option under the Presentation tab.

Regards,

Philippe