Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i try to find the date when the max value occures.
Example table:
Car | Date | Price |
---|---|---|
BMW | 01-05-2001 | 2345,00 |
VW | 03-05-2001 | 1555,00 |
BMW | 25-07-2004 | 4533,99 |
VW | 19-04-2003 | 2999,99 |
BMW | 02-12-2005 | 4999,99 |
First i have to say my table is animated.
Means i use Max({<Date={'<=$(currentDate)'}>}Price) in Expression.
currentDate is a variable, with changes every second.
Now i want to find the linked date, when the max Price occurres.
I tried:
FieldValue('Date',FieldIndex('Price',Max({<Date={'<=$(currentDate)'}>}Price)))
but it's not working...
Any ideas?
Thx
Sarah
Hi Sarah,
Have you tried using FirstSortedValue()? This will fetch the Date for the Max Price value.
Firstsortedvalue(DISTINCT Value, Date)
I've created video tutorial on my blog. Please check this link...
I hope this helps! BTW - I'd recommend using animated/Now() functions in the dashboard. It might work okay but there will be constant CPU overhead. I'm sure you're aware of this.
Good luck!
Cheers,
DV
Hi Sarah,
Have you tried using FirstSortedValue()? This will fetch the Date for the Max Price value.
Firstsortedvalue(DISTINCT Value, Date)
I've created video tutorial on my blog. Please check this link...
I hope this helps! BTW - I'd recommend using animated/Now() functions in the dashboard. It might work okay but there will be constant CPU overhead. I'm sure you're aware of this.
Good luck!
Cheers,
DV
Thx for the reply!
Yes, FirstSortedValue(distinct Date, -Price) solves the problem.
Very nice and compact function!
Also some very informative movies:)
I'm happy that u understand how to animate with now()-function, so i have to use this chance to ask some questions about the experience with "self-animated" charts^^
What do u mean with constant CPU overhead?
I know that the animation needs more CPU than normal charts, but not in an damaging amount...
Do u think, that animating with the now()-function should be avoided?
Or is it a question of performance?
Hi Sarah,
I'm glad you solved it by using FirstSortedValue() function. It's one my favourite function in QlikView.
I did some animations using Now() to show stock live in a store. I.e showing/hiding images based on time and using source data of current available stock. It works fine but if you have massive application with loads of calculations then it will bring down the peformance & user experience. As you understand that QlikView caches all the calculations until Working Set Limits are reached. So performing calculations every second may not be a good idea if you have complex calculations or variables.
It's not recommended but it doesn't matter if it's simple application and if it's already working fine. Probably you should come up with mathematical approach of calculating once every few minute instead of every second.
Good luck!
Cheers,
DV
Thank u very much!