Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
mishraamit2485
Creator
Creator

Set clear state on a variable

Hi All, Can we set a clear state on a button the action behind that button action behind that button is to select current month out of all the months.

Suppose I'm hitting clear button so this month its should go on Oct next month it should go on Nov.

Currently what is happening it is storing this month(Oct) when i'm setting the clear state where as next month also it is Oct only...i want something where it selects dynamic selection(Oct this month Nove next), instead of static (Stores Oct) only.

23 Replies
Anonymous
Not applicable

how about  a Trigger as yourmonthfield "=month(today())" on your button object?

jsingh71
Partner - Specialist
Partner - Specialist

use this:

vVariable = Month(Today())

This will store the current month. Use Select in Field action on clear button.

Field is your Month Filed and condition will be : =Month = Month(Today())

mishraamit2485
Creator
Creator
Author

Data is not driving from the system date, I have to use that data which is coming from backend, it might be yesterdays data on today's date, i have to use that only.

jsingh71
Partner - Specialist
Partner - Specialist

You need to compare this date with your script data date.

neha_sri
Creator III
Creator III

you can add trigger . On open add action>Select in field>, your field name and in search string

=month(Today())


Regards,

Neha

mishraamit2485
Creator
Creator
Author

Attached the sample app, instead of Month i need to select quarter, and that too the numbers we are getting from the database.

mishraamit2485
Creator
Creator
Author

Hi Neha, attached the sample app, please check..instead of month i need to select latest qtr which i coming from db

Anonymous
Not applicable

please define a trigger on open document like below

= max({1}Qtr) -> if you want the latest quarter to be selected

be aware if you have more than 1 year you Need to select last year first

mishraamit2485
Creator
Creator
Author

I want this on clear not on open document , when i hit the clear button it should go on the current qtr.