Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I have an income statement in my Qlik Sense application.
I am able to calculate the percentage of the row value related to the revenue. Now i am trying to calculate the same percentage for last year but haven't been successful.
Here is the code for this year that works:
sum(Test11) / sum(TOTAL {$<[ReportLineDescription] = {'Revenue'}>} Test11)
So what is wrong with this script:
(sum({$<Vvvv = {$(=Only(Vvvv)-1)}>} Test11)) / sum(TOTAL {$<[ReportLineDescription] = {'Revenue'}>}{$<Vvvv = {$(=Only(Vvvv)-1)}>}Test11)
if vvv is year then
(sum({$<Vvvv = {"$(=year(today())-1)"}>} Test11)) / sum(TOTAL {$<[ReportLineDescription] = {'Revenue'},Vvvv = {"$(=year(today())-1)"}>}Test11)
What is Vvvv ?
is that date field?
do you have year field?
Ohh, sorry the explanation was incomplete. The Vvvv = year
Try something similar
Assuming you have a date field date1, you have to replace date1 with your date field
sum({<date1={"=Year(date1)=year(today())-1"}>}Test11) / sum(TOTAL {$<[ReportLineDescription] = {'Revenue'},date1={"=Year(date1)=year(today())-1"}>} Test11)
if vvv is year then
(sum({$<Vvvv = {"$(=year(today())-1)"}>} Test11)) / sum(TOTAL {$<[ReportLineDescription] = {'Revenue'},Vvvv = {"$(=year(today())-1)"}>}Test11)
Maybe like this
(sum({$<Vvvv = {$(=max(Vvvv)-1)}>} Test11)) / sum(TOTAL {$<[ReportLineDescription] = {'Revenue'}>}{$<Vvvv = {$(=max(Vvvv)-1)}>}Test11)