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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Cascader
Creator
Creator

inquiry about inmonth function

Hi

can anyone explain what the following expression when it's being multiplied by -1 means?

inmonth (date(TempDate) , date(floor(today())), 0 )*-1
Labels (3)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Inmonth() - returns true(-1) or false(0). Multiplying it with -1, means it returns 1 if true else 0. Hence, for your case - if TempDate belongs to the same month as today then 1 else 0. So it's basically being used for flagging, perhaps in a calendar or date in fact table.

View solution in original post

1 Reply
tresesco
MVP
MVP

Inmonth() - returns true(-1) or false(0). Multiplying it with -1, means it returns 1 if true else 0. Hence, for your case - if TempDate belongs to the same month as today then 1 else 0. So it's basically being used for flagging, perhaps in a calendar or date in fact table.