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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Why multiply by(-1) in Flags?

Please let me know

Labels (1)
3 Replies
mseeck75
Partner - Contributor III
Partner - Contributor III

Hello Kay,

what do you mean with flags? Can you please post some more information about your problem.

BR

Matthias

MarcoWedel
MVP
MVP

please specify your question.

One possible answer:

logical value true is represented by -1

regards

Marco

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

We generally want our flags to be positive 1 so we can use the flag in a multiplication expression like:

=sum(LineSalesAmount * CurYTDFlag)

In qlikview, True is represented by -1. If the flag is created in script using a function that returns true/false (like InYearToDate) we multiply the result by -1 to derive a positive flag. For example:

InyearTodate(mydate,today()) * -1 as CurYTDFlag

-Rob