13 Replies Latest reply: Apr 19, 2010 7:56 AM by umangu2000

# 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:

 Day Price 1 1000 2 1008 3 1008 4 1017 5 1025 6 1028 7 1037 8 1037 9 1042 10 1046 11 1051 12 1057 13 1058 14 1064 15 1070 16 1077 17 1078 18 1082 19 1092 20 1101 21 1109 22 1109 23 1118 24 1129 25 1137 26 1145 27 1155 28 1160 29 1170 30 1178

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

• ###### Getting the Min & Max values for the selected period

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

• ###### Getting the Min & Max values for the selected period

Hi,

This doesnt seems to work. Pls help

• ###### Getting the Min & Max values for the selected period

The attached QV does not work

• ###### Getting the Min & Max values for the selected period

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

• ###### Getting the Min & Max values for the selected period

Hi Umang,

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

Regards,

Ankur

• ###### Getting the Min & Max values for the selected period

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

• ###### Getting the Min & Max values for the selected period

Hi,

- Sridhar

• ###### Getting the Min & Max values for the selected period

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

• ###### Getting the Min & Max values for the selected period

Hello Umang,

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

Regards,

Ankur

• ###### Getting the Min & Max values for the selected period

Hi,

SInce you have a older version of Qlikview. It doesnt support setanalysis deature.

Have a look at the attached application with simple if statement .

- Sridhar

• ###### Getting the Min & Max values for the selected period

Hi,

I am really grateful for you to take time out for solving my query.

What does VMin & VMax stand for in the example and would the example work if the price on the last selected day is lesser then the price of the first selected day?

thanks

• ###### Getting the Min & Max values for the selected period

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

• ###### Getting the Min & Max values for the selected period

Thanks a lot finally can finish my assignment