Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Picking specific data for the given year

Hi, I am trying to load a data from a table which has few columns with one column as a year. When i use the following function it works

Sum({$<ValidForYear={$(=Year(Today())-1)}>}NetMaximumCapacity)

but when I use  the following function it returns nothing.

Sum({$<ValidForYear={$(=Year(DeliveryDate))}>}NetMaximumCapacity)

ValidForYear is the column with year and DeliveryDate is the Calendar date.

I need to get the value from "NetMaximumCapacity" for the year selected by user based on data in other tables where "DeliveryDate" is used as date and time field.

3 Replies
sunny_talwar

May be try adding a max in there and see if that helps

Sum({$<ValidForYear={$(=Year(Max(DeliveryDate)))}>}NetMaximumCapacity)

Not applicable
Author

Thanks Sunny, I couldn't explain it properly. I want to get a value from DIM_PLANT table for a specific year as given in field "ValidForYear" in a time series graph, here is the image of the data tables in general and DIM_PLANT. I want values as per the below graph. Expression "Sum({$<ValidForYear={$(=Year(Max(DeliveryDate)))}>}NetMaximumCapacity)" give me values for just 2017 but I want the values to change as per the year based on Date.


Thanks for your time and response.

Expected output.PNGDIM_Plant_table.PNGQlik_Data_tables.PNG

sunny_talwar

How about try just the if statement then

Sum(If(ValidForYear = Year(DeliveryDate), NetMaximumCapacity))