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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
MIKIEMILLER
Contributor III
Contributor III

Max Value based on if statement

Hello,

I have information like the sample below and I am trying to make a table that looks like the second image.

Example1.GIF

Example2.GIF

 

 

The problem I am running into is the Savings is summing all the savings for every ID2, and if there are two results, it is only showing one, and the other is a null value.  And if I bring in Results as a dimension, it gives me incorrect totals.

 

I have ID and ID2 as dimensions.

My expressions(that are working properly) are:

Max Year:        Max({<[CAppeal?]={'Y'}>}[Year])

Years Since last Appeal:        Year(Today(2))-Max({<[Appeal?]={'Y'}>}[Year])

 

 

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Result: FirstSortedValue({<[CAppeal?]={'Y'}>} Result, -[Year])

Savings: FirstSortedValue({<[CAppeal?]={'Y'}>} Savings, -[Year])


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Channa
Specialist III
Specialist III

try to check data type 

can you make simple not clear

Channa
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Result: FirstSortedValue({<[CAppeal?]={'Y'}>} Result, -[Year])

Savings: FirstSortedValue({<[CAppeal?]={'Y'}>} Savings, -[Year])


talk is cheap, supply exceeds demand
MIKIEMILLER
Contributor III
Contributor III
Author

I tried using FirstSortedValue as some point, but was using the wrong fields.  Thank you for your help.