Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jharke
Creator II
Creator II

syntax of a trigger

Hello everybody,

I am looking for some rules about syntax needed to set a trigger.  Are there some plain guidelines?

For example: I have made a variable vInvoiceweek, defined as Num(week([Invoicedate]),'00')

Now I want to make a button that selects the last week as invoiceweek (to see what is invoiced last week)

I like to know:

-Do I need a dollar sign in the triggerfield (eguals sign is not needed)

-Do I need quotes in the search text? Do I need  the equals sign?

In case of my example:

Field:  vInvoiceweek   + Searchtext: week(now())-1 Does not work.

Searchtext between quotes also not. Field with a dollarsign also not. Searchtext with =sign also not. And so I can make some more combinations...

Please can anyone give some explanation (maybe by using this example) (I don't need only a correct answer for this example, but I would like an explanation why something works or doesn't work also).

There is a good trilogy of Henric Cronström about 'The little equals sign' , 'The magic of Variables' and 'The magic of Dollar Expansions'  (https://community.qlik.com/blogs/qlikviewdesignblog/2014/11/24/the-equal-sign

but that is a bit too complicated  (maybe in the future )

12 Replies
antoniotiman
Master III
Master III

Hi,

Foor() takes integer of WeekStart/WeekEnd, so it  Compares with integer Date.

If You remove this

WeekStart(Today) -> 04/07/2016 and this in Expressio needs quotes '04/07/2016'.

Regards,

Antonio

jharke
Creator II
Creator II
Author

Thank you

I did not know this Flooring function. Due to your post I went searching and learned a lot about setting dates. FLOOR can be used to make integer of dates. In my case it was not necessary, because the dates are already integers (timestamp 0:00:00).

If I use NUM in stead of FLOOR, it also works.

If I 'force' the expression to be a number (something I use a lot in Excel) the outcome gives me also the correct week and is a bit shorter, but gives a strange 'current selections'. If someone can tell me what that 999..88 means, I'd be glad...

Nice post about setting dates and understanding FLOOR:QlikView Date fields

antoniotiman
Master III
Master III

Num(WeekEnd(     has decimal portion.

so You need to use Floor()