Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Error in expression

Hello All,

Could you please help me with this expression:

=Count({<Mois_enquete_calcul={'>=$(=Max(Mois_enquete_calcul) - 5)<=$(=Max(Mois_enquete_calcul))'},Q11={'OUI'}, MARQUE={'CITROEN'}>}Q11)

Qlikview says that the Expression OK but unfortunately I do not get any result.

Many Thanks,

Hasvine

9 Replies
sureshqv
Esteemed Contributor III

Re: Error in expression

=Count({<Mois_enquete_calcul={">=$(=Max(Mois_enquete_calcul) - 5)<=$(=Max(Mois_enquete_calcul))"},Q11={'OUI'}, MARQUE={'CITROEN'}>}Q11)

Re: Error in expression

The syntax of the expressions is fine. Please post a small qlikview document that demonstrates the issue.


talk is cheap, supply exceeds demand

Re: Error in expression

if Mois_enquete_calcul is in proper date format then below expression should work


Count({<Mois_enquete_calcul={">=$(=Max(Mois_enquete_calcul) - 5)<=$(=Max(Mois_enquete_calcul))"},Q11={'OUI'}, MARQUE={'CITROEN'}>}Q11)

Not applicable

Re: Error in expression

But if Mois_enquete_calcul is in the format of Month-Year.

I used the expression below to calculte it:

Month(subfield([DATE_FACTURATION], ' ' ,1)) & '-' &  Year(subfield([DATE_FACTURATION], ' ' ,1)) as Mois_enquete_calcul,

This is how it looks like:

Many thanks to everyone for your help.

Kind Regards,

Hasvine

stabben23
Honored Contributor

Re: Error in expression

if you put this Expression in a straight table, what does is stand in the "label header" if you keep it blank and hover over it?

Re: Error in expression

Ok, so it's a text field. The max function doesn't work well with text fields. Try creating it like this:

Date(MonthStart(subfield(DATE_FACTURATION,' ')),'MMM-YYYY') as Mois_enquite_calcul.


talk is cheap, supply exceeds demand

Re: Error in expression

It's in not proper date format, do this like below

date(date#(Month(subfield([DATE_FACTURATION], ' ' ,1)) & '-' &  Year(subfield([DATE_FACTURATION], ' ' ,1)),'MMM-YYYY'),'MMM-YYYY') as Mois_enquete_calcul


Now your expression should work

Not applicable

Re: Error in expression

Hello All,

Thanks you for your ideas, the good news is that now my chart shows the result but it doesn't give me only 6 months but more.

Following my selection on déc-2015 i want Qlikview to show me the month of nov-2015, oct-2015, sept-2015, aug-2015 and jul-2015

but instead, it is giving me all the months before dec-2015

Any idea how to solve this?

Many Thanks,

Hasvine

stabben23
Honored Contributor

Re: Error in expression

Try this,

Count({<Mois_enquete_calcul={">=$(=(Addmonth(Mois_enquete_calcul, - 5)))<=$(=(Addmonth(Mois_enquete_calcul,0)))"},..........

Community Browser