Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
IAMDV
Luminary Alumni
Luminary Alumni

Multi value Slider variables in Set Analysis

Dear All,

I am using a Slider (object) with Multi value with TimeStamp. I had attached the screenshot for your reference. And I am using the following expression to calculate the value for Current Hour.

COUNT({$<TimeStampValue = {$(=($(vMaxCurrentTime)))} , Q_No ={'Q1'} >} Resp_ID)

However, I wanted to look at multiple continious hours, like 6 AM to 10 AM. I am saving the values in variables... like Minimum & Maximum value to calculate the time. But I am not sure on how to integrate the range in the above expression. Something like this... (Highlighted in red color for readability).

COUNT({$<TimeStampValue >= {$(=($(vMINCurrentTime)))} AND TimeStampValue <= {$(=($(vMaxCurrentTime)))} , Q_No ={'Q1'} >} Resp_ID)

I hope this makes sense...


ScreenShot.jpg

Many thanks in anticipation!

Cheers - DV

5 Replies
erichshiino
Partner - Master
Partner - Master

HI,

You should include both conditions inside {}

Try this:

COUNT({$<TimeStampValue = {'>$(=($(vMINCurrentTime))) <=$(=($(vMaxCurrentTime))) '} , Q_No ={'Q1'} >} Resp_ID)

(please double check the number of parentesis in my expression)

Regards,

Erich

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Not quite... The syntax of Set Analysis Modifier is :

Field = {Values}, where the "equal sign" is not to define that the field is equal (or greater then) the Values, but rather to determine what to do with this selection and with the User Selections. "=" means "replace user selections with those values", other operators like "-=" and "+=" may mean subtracting or appending selections.

So, for your purpose you need to define a range in the form of a search condition (double quotes signify search):

COUNT({$<TimeStampValue = {$(">=$(vMINCurrentTime)<= $(vMaxCurrentTime)"} , Q_No ={'Q1'} >} Resp_ID)

You also need to watch for a possible mismatch of the date/time format. Variables can only hold either formatted values or numeric values of the timestamps, but not both. The format of the variable needs to be exactly the same as the format of your field TimeStampValue.

Best,

IAMDV
Luminary Alumni
Luminary Alumni
Author

Oleg - Thank you very much for explanation. I will try the same and I just wanted to check if there is any range function with gets the possible values between min & max values... instead of using the <MaxValue and >MinValue.

Thank you again for your time.

Cheers - DV

IAMDV
Luminary Alumni
Luminary Alumni
Author

Thank you Erich & Oleg

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

No, not that I can think of... I always use the >Min<Max approach...