Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

Expression Help

hi ,

i am using date range selection and its working but facing one issue

below is my expression

avg({< Timestamp = {'>=$(=Date(vStartDate)) <=$(=Date(vMinDate))'}  >}Temperature)

let say i have select vStartDate = 01-10-2015

and vMinDate = 09-10-2015

with my expression i m getting data 01-10-2015 to 08-10-2015,  why i m not getting data for 09-10-2015 ?

pls suggest

8 Replies
tamilarasu
Champion
Champion

Hi Abhay,

Your expression looks fine. Could you do a test by copy paste the below in text box and see. What value the variable return. I guess, minimum date will be the problem.


=Date(vMinDate)

abhaysingh
Specialist II
Specialist II
Author

yes i have checked, in Text Box it is giving me selected MinDate

abhaysingh
Specialist II
Specialist II
Author

PFA,test app

tamilarasu
Champion
Champion

Your date format seems wrong. In list box, I can see same date replicated many times. Your date field contains date and time together.

s.PNG asas.PNG

Change the load script as below.

LOAD 

    AssetInstanceId,

    Sensor_ID,

   date(floor(Timestamp)) as Timestamp,

    [Min-Max °C],

    MasterLinkDate,

    Temperature

FROM

(ooxml, embedded labels, table is Sheet1);

abhaysingh
Specialist II
Specialist II
Author

Actually there is a timestamp with each date that's why there are multiple date for same day

Mark_Little
Luminary
Luminary

Hi,

I think that will be the problem.

You are not comparing like fir like. So i think you will either have to add a time stamp to the vairable, or take the date from Timestamp field Like


date(floor(Timestamp)) as Date


Then use just the date


Mark

tamilarasu
Champion
Champion

You are using the Timstamp field in you set analysis. You need to change field name as I mentioned.

asasss.PNG

vincent_ardiet
Specialist
Specialist

Use daystart function:

avg({< Timestamp = {'>=$(=DayStart(Date(vStartDate))) <$(=DayEnd(Date(vMinDate)))'}  >}Temperature)