Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max(Year) is not working in my expression

Hi All,

I want to pass the Max(Year) dynamically instead of statically(START_YEAR='2010' ). Any idea how to do the same?

I tried to pass $<START_YEAR={$(=Max(START_YEAR))}>} instead of START_YEAR='2010' but it didn't work. Please help me out


=ceil(sum(if( START_YEAR='2010' and wildmatch(Category,'*Call1*') > 0 and (wildmatch([Agreement Met],'no')>0),1,0)) /
sum(if(START_YEAR='2010' and wildmatch(Category,'*Call1*') > 0 ,1,0)) ,.01)







18 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

hi Attitude,

Tyr out the below expression

Sum({<Year={$(=Max(Year))}>} Sales )

Not applicable
Author

Thanks Deepak

Samething I tried in my expression but it didn't work. Please check and let me know what shall be done for this. I know it is very simple only but some time even small things are very difficult in qlikview.

deepakk
Partner - Specialist III
Partner - Specialist III

HI Attitude,

the Syntax which you have shown on top and what I added is different. There is a dollar sign difference.

It might be a small problem.

You can also check in the template What's New in QLikview 9.0.

I have taken the expression from the Dashboard tab and its working fine there.

Not applicable
Author

HI Deepak,

I tried that by removing the $ sign also but still I didn't work. 🙂

We might have copied it from where it works but it should work inside this expression that is more important.

deepakk
Partner - Specialist III
Partner - Specialist III

Can you attach you application. I can check and let you know on the same.

or else.

check what value are you getting in max(Year) and compare it with field, there might be a data mis match. Thats only i can think of now. If you can attach the application I will have a better view.

Not applicable
Author

Sorry cannot attach the application! Please try to help me out without that

deepakk
Partner - Specialist III
Partner - Specialist III

hi Attitude,

you can try out with if statement.

if(max(Year) = vYear , Sum(Amount)).

where vYear is the variable which contains vYear =max(Year).

But i still suggest the set analysis method.

if you can copy paste sample data for 2010 i can show you how it can be done.

Not applicable
Author

Hi Attitude,

I am not clear on your logic since you are comparing the same column START_YEAR against START_YEAR. Are you looking forward as the expression should get calculated only for the maxium year ?

Not applicable
Author

I am just trying to pass the Max(START_YEAR) in to the START_YEAR. Something like this START_YEAR='2011'. Hope it is clear now...