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: 
Not applicable

Trouble setting up trigger for Quarter

Hi i'm trying to create a trigger for each tab which will autumatically select the current year and quarter. I have managed to do it for year but it is not working for Quarter.

For year my field would be PostingYear and the script for it is =Year(Today()) and for quarter the field would be PostingQuarter and the script i gave was =ceil(month(today())/3).

I have even tried =Max(PostingQuarter) but it failed.

Could someone help me on this. Thank you.

1 Solution

Accepted Solutions
fosuzuki
Partner - Specialist III
Partner - Specialist III

I think that your PostingQuarter is a string type, like 'Q1', 'Q2', ... right?

So:

- The ceil() function returns a numeric value so it will not match any value in your field.

- The max() function only returns numeric values. If the PostingQuarter field is a string type, the function will return null value.

Try these two options:

='Q' & ceil(month(today())/3)

= MaxString(PostingQuarter)


View solution in original post

2 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

I think that your PostingQuarter is a string type, like 'Q1', 'Q2', ... right?

So:

- The ceil() function returns a numeric value so it will not match any value in your field.

- The max() function only returns numeric values. If the PostingQuarter field is a string type, the function will return null value.

Try these two options:

='Q' & ceil(month(today())/3)

= MaxString(PostingQuarter)


Not applicable
Author

At first if did not work but later the request was changed from tab to document trigger and now it works just perfectly. Thank Fernando once again for saving my day.