Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Chanty4u
MVP
MVP

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

Gysbert_Wassenaar

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


talk is cheap, supply exceeds demand
Kushal_Chawda

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
Author

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
Partner - Master
Partner - Master

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?

Gysbert_Wassenaar

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
Kushal_Chawda

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
Author

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
Partner - Master
Partner - Master

Try this,

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