Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jjremy
Contributor II
Contributor II

Sum with a 'flexible' filter over a field

Hello,

Maybe it is a basic question (since I found no post covering this), but my problem is the following.

Each month, we have some datalines with some income values for the different years.

So for there are 3 field:

* stand (which contains values like 23/12;24/01;...)

* ONGJR (it contains year, so 2023 or 2024)

* PREMIE (this one has information about the income)

So for each possible tuple (stand,ongjr), we have a couple of lines with the different incomes.

I want to make a graph that follows the evolution of the income.
If I write this:

Sum ({$<ONGJR ={2023}>} PREMIE)

I get a line that just follow the evolution of the income for the year 23.

jjremy_0-1729517592169.png

Now, my ultimate goal is not to follow the income of 2023, but it would be that at 'stand' 23/12, I see the value of the year 2023, but at 'stand' 24/01, 24/02, ... I get the value for 2024.

My try was to replace 2023 by 2000+left(stand,2). This is indeed equal to 2023 for stand 23/12 and equal to 2024 for the stands starting with 24. (and it would work in 2025 too)
But somehow this doesn't work. I get the following error message:

jjremy_1-1729517839490.png

So I guess something is missing in my formula, but I've tried a couple of things, nothing worked. Or maybe I should do it in another way?

Feel free to ask if you need some more information.

Thanks for your time and help, and have a nice day,

 

Labels (5)
1 Reply
Qrishna
Master
Master

some dummy data to replicate your scenario plz?