Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a QV table with an expression that looks like below.
As you can see from the picture it doesn't seem to add upp in the column total and I can't figure out why.
The expression looks like this:
MålkortsDatum = Date formated as YYYY-MM-DD
SVDate (Variable) = 2018-10-30
SlutprognosAnsvar = number column (data from excelfile)
ProjektNr = number column (data from excelfile)
AnsvarNr = number column (data from excelfile)
FirstSortedValue({$<MålkortsDatum={"<$(SVDate)"}>} distinct aggr(Sum({1<MålkortsDatum={"<$(SVDate)"}>}SlutprognosAnsvar), ProjektNr, AnsvarNr, MålkortsDatum),-MålkortsDatum)
Thank you for the information Stefan,
I ended up rewriting the expression after getting a better understanding of the expressions and this is the end result:
Sum({$<MålkortsDatum={"<$(SVDate)"}>}AGGR(FirstSortedValue(SlutprognosAnsvar, -MålkortsDatum), ProjektNr, AnsvarNr))
If you say 'add up' that means you want a sum of rows in your pivot table?
Try adding the the Sum(Aggr(..., YourChartDimensions)) like
=Sum({$<MålkortsDatum={"<$(SVDate)"}>} Aggr(
FirstSortedValue({$<MålkortsDatum={"<$(SVDate)"}>} distinct aggr(Sum({1<MålkortsDatum={"<$(SVDate)"}>}SlutprognosAnsvar), ProjektNr, AnsvarNr, MålkortsDatum),-MålkortsDatum)
,ProjektNr, AnsvarNr))
That is awesome!
Why does it work when using a second aggr argument?
Thank you for the information Stefan,
I ended up rewriting the expression after getting a better understanding of the expressions and this is the end result:
Sum({$<MålkortsDatum={"<$(SVDate)"}>}AGGR(FirstSortedValue(SlutprognosAnsvar, -MålkortsDatum), ProjektNr, AnsvarNr))