Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nikhilgarg
Specialist II
Specialist II

Button 1D not working

Hello,

I tried to make an application where i am trying to show data as per 1D, MTD and YTD. i ahve make trigger on 1D but it is not working can someone tell mewhy .

Thanks

11 Replies
sunny_talwar

Couple of changes and it is working now.

Capture.PNG !

sunny_talwar

‌Those were the only two changes I made (i think). Make those two changes and see if it works.

nikhilgarg
Specialist II
Specialist II
Author

Hey,

Thanks it works but in case of MTD i am stucking somewhere.

For MTD:

i used 2 var:

vDateMin = =MonthStart(max({1}LoginTime))

vDateMAx = =max({1}LoginTime)

In button's action's tab i have used 2 setvariable for these and in SelectInField i have used LoginTime with value:

>= vDateMin and <= vDateMax

Where am i wrong ?

sunny_talwar

Try this for your select in field: ='>=' & vDateMin & '<=' & vDateMax

nikhilgarg
Specialist II
Specialist II
Author

Hey,

I tried this but still not working. I have attached the file. Please have a look.

Thanks

sunny_talwar

It is working but you are just not seeing it make the selection because All the LoginTime dates are within the range you have specified here.

Look at the green dot next to the column LoginTime

Before:

Capture.PNG

After:

Capture.PNG

sunny_talwar

Actually found the bug. You need to change the definition for vDateMin to this:

=Date(MonthStart(max({1}LoginTime)), 'YYYY-MM-DD')

HTH

Best,

Sunny

nikhilgarg
Specialist II
Specialist II
Author

Hey,

Actualy it is working but not in correct way. Well the loop was in MTD vDateMin expression:

I used the expression:

=MonthStart(max({1}LoginTime))  which gives date in DD-MM-YYY format while my dates are in 'YYYY-MM-DD' format.

So, i have used:

=date(MonthStart(max({1}LoginTime)), 'YYYY-MM-DD')  It is working now.

Thanks

nikhilgarg
Specialist II
Specialist II
Author

Hey sunny,

one more thing. I want to make YTD as default filter for data when user comes to this sheet. So how can i do that ? Althoughj i have added triggers on Sheet. But still it is not working fine. Even when clear is selected, YTD data sld be shown. I ahve attached the file. Pls suggest.

Thanks