Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
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: 
amit_saini
Master III
Master III

Button Help????

Hi Folks,

I'm having to variables as mentioned below:

vDateStart   =timestamp($(vDtStart) + $(vTsStart)/24)

vDateEnd =timestamp($(vDtEnd) + $(vTsEnd)/24)

Requirement: Please help me how to create a button by using these two variables or without them to see yesterday 6:00 AM to Today's 6:00 AM data.

Note: I'm using vDateStart and vDateEnd variables in all my expressions inside Pivot table  and by pressing this button data should change automatically .

Thanks,

AS

11 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

Below Application might help you.

Regards

ASHFAQ

Not applicable

you have to set a trigger when you click the button to change the value to yesterday 6am to today 6am and then you can still use it in set analysis. meaning you dont have to change your expression.

regards,

MT

amit_saini
Master III
Master III
Author

Hi Magdalena,

Could you please share any demo application if possible.

Thanks,
AS

amit_saini
Master III
Master III
Author

Ashfaq,

Thanks for the help, but in your case you are having date filed , in my case there is no such date field . I need solution by using these two variables.

Thanks,

AS

CELAMBARASAN
Partner - Champion
Partner - Champion

How could you identify without date field whether data is today's or yesterdays one?

Because formula would be based on that only

amit_saini
Master III
Master III
Author

Celambarasan,

I'm using variables over here, it can be done using assigning today's and yesterday's value to these variables.

vDateStart   =timestamp($(vDtStart) + $(vTsStart)/24) 

vDateEnd =timestamp($(vDtEnd) + $(vTsEnd)/24)

I have created a Calender by using vDtStart and vDtEnd  by assigning them values  from =Date('01.01.2012', 'DD.MM.YYYY')  to =Today() , where a user can select any date  .

Also I have created a Slider for selecting time ranges by using vTsStart and vTsEnd variables. Please see this image.

Here for example I have selected 5th May 2014 as from and to but I have selected time from 4:00 AM till 5:00 AM same dat , and you can see below in Production Overview table data got changed accordingly.

Available Time showing is exactly 01:00 hrs difference which is correct.

And in my all expressions I 'm using vDateStart and vDateEnd , so whenever a user selecting any date and time range as described above data will automatically change in table.

Further here I want a button , which can gives me Yesterday's and Today's 6 to 6 AM.

Please suggest or help me out here.

Thanks,

AS

CELAMBARASAN
Partner - Champion
Partner - Champion

Use this 2 set variable actions

vDateStart   =timestamp(Today() - 1 + ((1/24) * 6))

vDateEnd =timestamp(Today() + ((1/24) * 18))

or

vDateStart   =timestamp(Today() - 1 + Time(Time#('06:00 AM', 'hh:mm tt')))

vDateEnd =timestamp(Today() + Time(Time#('06:00 PM', 'hh:mm tt')))

or

vDateStart   =timestamp(Today() - 0.75)

vDateEnd =timestamp(Today() + 0.75)

Anonymous
Not applicable

Hi amit,

can you post your qvw or an example? I agree with Magdalena. You should use some triggers.

Best regards

amit_saini
Master III
Master III
Author

Hi ,

Mentioned below is my test application. Kindly have a look on it.

Thanks,
AS