Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Sum of value for min date

hi,

on a table I have Date Column and then a value column and also a column with flag

on a table chart, I want to have Date, Min Date, Sum values, Value on Min Date.

I used

Sum(if(Flag = 1 and [Date]= Min(Total <[Date]> [Date]),[Value])) to show value of the minimum date but getting null.

Anyone can help.

Thanks

1 Solution

Accepted Solutions
alec1982
Specialist II
Specialist II
Author

I finally got it to work using the following in set analysis

[Date]= {'$(=Min({<Flag= {'1'}, Name= {'AB'}>}Total <[Date]> [Date]))'}

View solution in original post

14 Replies
swuehl
MVP
MVP

Try

=Sum( {<Flag = {1}, [Date] = {'$(=Date(Min({<Flag = 1>}[Date])))'}>} Value)

alec1982
Specialist II
Specialist II
Author

Thanks Stefan. it still shows null values

swuehl
MVP
MVP

Are your dates correctly interpreted as such?

Could you upload a small sample?

Why don’t my dates work?

Dates in Set Analysis

alec1982
Specialist II
Specialist II
Author

When using the following formula in a column

if(Flag = 1 , Min(Total <[Date]> [Date]))

I get the right date and the format in MM/DD/YYYY

Thanks again

swuehl
MVP
MVP

What is the chart context (dimensions used)?

alec1982
Specialist II
Specialist II
Author

The Date Column and it looks like this

date(if(Flag = 1 , [Date]),'MMM YY')

alec1982
Specialist II
Specialist II
Author

Still struggling with it.. Anyone can help.

Not applicable

assuming you are using this in a chart and the chart is ordered by Date, can you try this.

Sum(if(Flag = 1 and [Date]= FieldValue('Date',1), Value)

alec1982
Specialist II
Specialist II
Author

it gives null value