Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
I´m having problems with an Aggr expression.
To selected year, it works fine, but when I use the same expression, just switching the set analysis to return resuts to previous year, it doesn´t return values.
Variables are returning the years correctly.
To current year: Aggr(sum({$<Ano={$(vcurrentYear)}>}Aggr(valor, idProdutoReservadoValor,Ano)), [Nome Social]) - This works fine!
To previous Year: Aggr(sum({$<Ano={$(vPreviousYear)}>}Aggr(valor, idProdutoReservadoValor,Ano)), [Nome Social]) - Returns 0.
Any ideas?
Thanks in advance.
Regards,
Bruno Silva.
I didn´t understand very well your datamodel.
Check if this expression returns what you need for last year
=sum({$<Ano={$(vAnoAntSeleccionado)}>}Aggr(sum({$<Ano={$(vAnoAntSeleccionado)}>}Aggr(only({$<Ano={$(vAnoAntSeleccionado)}>}valor), idProdutoReservadoValor,Ano)), [Nome Social]))
If possible please upload your sample file or apps.
I think your expression should be:
sum($<Ano={$(vcurrentYear)}>}aggr(sum($<Ano={$(vcurrentYear)}>}valor),idProdutoReservadoValor,Ano))
Sorry, but due to confidentiality issues, I cannot provide sample data.
Just tested... It returns full data results, not just the selected year. I think that it´s ignoring set analysis and even the selections made!
Do you have alternate states into your app?
This expression must respect your selections because of $.
Very weird
I do have Alternate States in the Document, but these Straight Table and the sheet has no active Alternate State. Furthermore, I created specific variables to test these expressions, because it wasn´t me that developed the app, and I wasn´t aware of the full implications of what was already developed.
If I´m not being clear with my text, ask to explain better, please. English is not my native language.
Thanks,
BS.
You can scramble your data, will make our life easier Preparing examples for Upload - Reduction and Data Scrambling
Here it is the reduced Qvw, as suggested by Clever Anjos.
The data that is returning as it is, it´s confirmed to be correct. So, any changes to expressions must return same values.
Thanks,
BS.
I didn´t understand very well your datamodel.
Check if this expression returns what you need for last year
=sum({$<Ano={$(vAnoAntSeleccionado)}>}Aggr(sum({$<Ano={$(vAnoAntSeleccionado)}>}Aggr(only({$<Ano={$(vAnoAntSeleccionado)}>}valor), idProdutoReservadoValor,Ano)), [Nome Social]))