Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts
I have the following problem:
I creadted a variable "VDateminus1year" with the the current date one year ago.
In a table chart I have the following code: Sum ({<Jahr={$(VaktJahr)}>} ([Rohertrag_aktJ])) giving me the sum of earnings in the current year.
Is it possible to change this code to sum up all earnings last year up to today one year ago, using my variable?
Thank you for your help!
Jan
Yes, it is possible. Create variable first and then try the expression below.
=sum({<Date={">=$(vStartPrevYTD)<=$(vEndPrevYTD)"}>}[Rohertrag_aktJ])
Variables:
vStartPrevYTD:=addyears(YearStart(Date ),-1)
vEndPrevYTD:=addyears(max(Date),-1)
try sum({<Jahr={=$(VaktJahr)-1},MyDatefield={<=$(CDateminus1year)}>}Rohertrag_aktJ
first paramter filters the previous year, while second paramter filters from beginning of previous year upto
today - 1 year
Yes, it is possible. Create variable first and then try the expression below.
=sum({<Date={">=$(vStartPrevYTD)<=$(vEndPrevYTD)"}>}[Rohertrag_aktJ])
Variables:
vStartPrevYTD:=addyears(YearStart(Date ),-1)
vEndPrevYTD:=addyears(max(Date),-1)
Hi Rudolf
I tried the following: Sum ({<Audtragsdatum_aktJ={$(VDateminus1year)}>} ([Rohertrag_aktJ]))
But that only eaquals the date. How do I set the condition < my date in the variable?
Best
Jan
try
{<=$(VDateminus1year)}
then ([Rohertrag_aktJ])) has a red line undeneath. thus does not work...
I send you an example of my current project, which works
sum
({<AuswahlMonat=,AuswahlJahr=,Berichtsdatum={'>=$(=$(vStartDatum)<=(=$(vEndDatum)))'}>}Kapitalstand)
Thanks you gave me a clue to a solution.