Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dimension depencence in expresions

Hi,

I'm trying to do an expresion that calculates the cuantity of something in this month divided by the Average of the three last month for every month.

I put the month as dimension (Calendarmonth) and that expresion :

count(lines)/((count(<{Calendarmonth={ ">=$(=AddMonths(MonthStart(max(Calendardate)),-3))<=$(=AddMonths(monthend(Max(Calendardate)),-1))"}lines)/3).

The problem is that if I put this expresion in a text field, the results are the expeted ones, but when I put the expresion in  graph, the results are not the expected cause the data I'm trying to count in the second part of the division is being affected by the dimension.

There is any way to avoid that?

Thanks.

5 Replies
jjfabian
Partner - Creator III
Partner - Creator III

Hi,

you can ignore dimensions in set analysis by adding 'yourdimension='.

Not applicable
Author

Hi Jakob,

I cannot add it cause the dimension is CalendarMonth and I cannot set it to nothing cause it have to be the three last months.

jjfabian
Partner - Creator III
Partner - Creator III

A solution would be to remove your dimension and add three separate expressions with a set analysis for each month - not pretty, but that would work 🙂

Not applicable
Author

I think I didn't explain well.

I need to have, for each month, the division between the actual value divided by the average of the three previous month, so I need the dimension.

For example:

     Apr = 3

     May = 5

     Jun = 1

  So the value of the expression in Jun will be : 1 / ((3+5+1)/3)

I hope you understand me

vincent_ardiet
Specialist
Specialist

Hi,

Have you try to use the ABOVE function ?

Rangeavg(above(count(lines),1,3)) will return the average of your expression evaluated on the 3 previous months (if the month is your dimension).

Regards,

Vincent