Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to compare in a simple table the amount for the year I have selected with the preceding year.
I am making a mistake in the definition of the expression for the preeding year because the table does not display any data.
This is what I´m doing:
FOR THE YEAR SELECTED: It works
$(=Max(MbrName_Anio))
({$ <[MbrName_Anio]= {$(=Max(MbrName_Anio))} > } [Importe real])
FOR THE PRECEDING YEAR: The Label works but the Expression don´t
$(=Max(MbrName_Anio)-1)
({$ <[MbrName_Anio]= {$(=Max(MbrName_Anio)-1)} > } [Importe real])
What am I doing wrong?
Thanks in advance for your answers!!
Basically you´re doing right.
Is it possible to post a app?
Hi,
move your -1 inside brackets, like: {$(=max(MbrName_Anio -1))}
Maybe MbrName_Anio is non numeric?
The Label is not paying attention to your Selection Set. It's just using the dollar sign expansion. That's why it works.
In your definition, you are defining the Selection Set as the current set using $, meaning that it's possible the Selection Set ( List Boxes highlighted green) references the current MbrName_Anio. If that's the case, you are eliminating MbrName_Anio-1 by selecting MbrName_Anio.
You can get around this by using ({1 <[MbrName_Anio]= {$(=Max(MbrName_Anio))} > } [Importe real]) or using an additional modifier to tell the Set Analysis Set to ignore a selection you've made in another QlikView Object ( List Box maybe?).
Hi,
ru using any set aggr function like sum,count avg ...beacause set doesn't work without them
sum ({$ <[MbrName_Anio]= {"$(=Max(MbrName_Anio)-1)"} > } [Importe real]) .
if you attached sample file then that would be great to help you
Hi,
Try several alternatives.
Like
1. Write $(=Max(MbrName_Anio)-1) in single quote ' '
Like
({<[MbrName_Anio]= {'$(=Max(MbrName_Anio)-1)'}>} [Importe real])
2.
store value of $(=Max(MbrName_Anio)-1) expression in variable
Like create variable varPreviousYear
and value should be =Max(MbrName_Anio)-1
Then use that variable in your set analysis
Like
({<[MbrName_Anio]= {"=varPreviousYear"}>} [Importe real])
Regards,