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

Getting the Min & Max values for the selected period

Hi,

For my analysis I need to select a particular period in days and need to get the corresponding values of the Prices for the selected period.

For example:

DayPrice
11000
21008
31008
41017
51025
61028
71037
81037
91042
101046
111051
121057
131058
141064
151070
161077
171078
181082
191092
201101
211109
221109
231118
241129
251137
261145
271155
281160
291170
301178

Lets say I select the preiod starting from Day 20 - Day 30 - I need a formula to get 1101 (the price on day 20) and 1178 (the price on day 30. The price needs to change as and when the selection is made

Please help

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

VMax and V Min are two variables to store the the Maximum and Minimum values of the selection.

VMax =Max(Day)

VMin =Min(Day)


If you select Day 20 to Day 30, VMAx and VMin will have the below values.

VMax = 30

VMin = 20

And i`m using this variable in if statement to restrict values.

"example work if the price on the last selected day is lesser then the price of the first selected day?"

Example will work in all cases, since i have not checked those conditions.

-Sridhar

View solution in original post

13 Replies
d_pranskus
Partner - Creator III
Partner - Creator III

Hi

Use something like this

For Start day Price MAX({$<Day={$(=MIN(TOTAL Day))}>} Price)

For End day Price MAX({$<Day={$(=MAX(TOTAL Day))}>} Price)

First MAX function is necessary just for aggregation

Cheers

Darius

Not applicable
Author

Hi,

This doesnt seems to work. Pls help

Not applicable
Author

The attached QV does not work

Not applicable
Author

Anybody can help me out here as Im really stuck [:'(]

Not applicable
Author

Hi Umang,

The above exmaple by Darius does work, Please have a second look.

Regards,

Ankur

Not applicable
Author

May I ask the version of QV you have - as the same is not working at my end

Not applicable
Author

Hi,

Check the attached application. Hope this will help you.

- Sridhar

Not applicable
Author

Thanks Sridhar,

But the code does not seem to work on my qlikview (version 6.8) , maybe i need to update the same and then check

Not applicable
Author

Hello Umang,

Both the applications work on QV 8.5 as well as QV 9.0.

Regards,

Ankur