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

Button Selection with Actions

Hello,

I want to show only current year and current month when user click the button

Lets assume, i have data like below

Date               Sales

01/01/2016     10

01/05/2016     20

01/01/2015     20

01/01/2014     30

01/01/2013     40   

01/01/2012     50

01/01/2011     60

01/01/2010     70


Here, I want to create when user click the Button then i want to show data which related to

Max(Year)  - Current Year

Current Max Month


How to add this actions into button?


Please help me                        

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
1 Solution

Accepted Solutions
sunny_talwar

5 Replies
Anonymous
Not applicable

At Back End only, create a field as

num(monthname(Date)) as MOnthname_Num

Now in properties of a buttoon define an action as

Select in Field >>

     Field>> Monthname_Num

     VAlue>> max(Monthname_Num)

This way the data in chart will always reflect for selected or the max year month....

reards

Nitin

Anil_Babu_Samineni
Author

Can you please send the qvw

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

I would use a date field to do this

='>=' & Date(MonthStart(Max({1}Date)), 'MM/DD/YYYY') & '<=' & Date(MonthEnd(Max({1}Date)), 'MM/DD/YYYY')

Assuming your date format is MM/DD/YYYY and not DD/MM/YYYY

sunny_talwar

Sample attached

Anil_Babu_Samineni
Author

Thanks Sunny

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful