Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Live Chat, June 29th 10AM ET. Bring your Qik Sense Enterprise, Client Managed questions! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
jelindbe
Partner
Partner

This year and last year

I have this expression:

if(Week(today())<19,

Sum({<År0101={'$(=year(today()-1))'},Framskrivningsalternativ={"Faktisk"}>}Folkemengde_fram_SSB),

Sum({<År0101={'$(=year(today()))'},Framskrivningsalternativ={"Faktisk"}>}Folkemengde_fram_SSB))

The first conditional expression is supposed to retrieve the sum for last  year. The second expression is supposed to retrieve the sum from the current year.

The first expression does not work correctly. Consequently, both expressions give me the same result (from the current year).

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

Hi,

try this:

if(Week(today())<19,

Sum({<År0101={'$(=Year(AddYears(Today(),-1)))'},Framskrivningsalternativ={"Faktisk"}>}Folkemengde_fram_SSB),

Sum({<År0101={'$(=year(today()))'},Framskrivningsalternativ={"Faktisk"}>}Folkemengde_fram_SSB))

View solution in original post

1 Reply
YoussefBelloum
Champion
Champion

Hi,

try this:

if(Week(today())<19,

Sum({<År0101={'$(=Year(AddYears(Today(),-1)))'},Framskrivningsalternativ={"Faktisk"}>}Folkemengde_fram_SSB),

Sum({<År0101={'$(=year(today()))'},Framskrivningsalternativ={"Faktisk"}>}Folkemengde_fram_SSB))

View solution in original post