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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight Table expression using a calculated field

Hi All,

I have a straight table of employee related data (days worked, contracted days etc.) that contains a number of calculated fields, one of which is 'overtimedays'. I am trying to put this field into another expression in the same table:

Sum({< [Entry Date] = {">$(=Date(Today() - ((17 * 7)+ [overtimedays] )))"}, Project_Type = {"Project", "Non_Project"} >} [Total Hrs])


However, this doesn't seem to work. If i replace [overtimedays] with a number, the expression works fine.

Any ideas how I can make this type of calculation work? I'm fairly new to QlikView.

Thanks!

12 Replies
Not applicable
Author

Could you explain how I make it a variable please?

johnw
Champion III
Champion III

As a simple example, let's say that your column expression is this:

sum(Sales)

You could create a variable (settings -> document properties -> variables -> new, among other methods) and set the value to sum(Sales). Then wherever you want to use it, use $(MyVariable) instead. The dollar sign expansion will then literally insert sum(Sales) where that expression is at execution time, so it's just as if you'd typed it in yourself, but it prevents dual maintenance when you're using the same expression in multiple places.

Not applicable
Author

Thanks John! First attempt this appears to do the trick, but let me play with it a bit more to be sure. I really appreciate your help.