Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare two columns from different tables in a condition in Qlik View

Hi,

I need to get current day's data where Table1.Column1_value > Table2.Column_2_Value.

Table2.Column_2_Value is a threshold value corresponding to column1 in Table1.

I tried with set analysis

Below mentioned set analysis gives the data for Today's date

Sum({<DATE= {"$(=Date(today(),'YYYY-MM-DD'))"}>}Sales)

But I can't add a field to field comparison inside  the above mentioned set analysis

I need a formula that gives the same data as the following query


Select Sum(Sales) from Table1 join Table 2 on (...)

Where Date=Today() and Table1.Column1_value> Table2.Column_2_Value



Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

And you need this in a chart?

Note that this might not perform very well on large data sets:

=Sum( If(Date = Today() and Table1.Column1_value > Table2.Column_2_Value, Sales))

You are only able to replace this with a set expression if you find a key that returns for each combination of your tableX columnY values a unique answer.

View solution in original post

2 Replies
swuehl
MVP
MVP

And you need this in a chart?

Note that this might not perform very well on large data sets:

=Sum( If(Date = Today() and Table1.Column1_value > Table2.Column_2_Value, Sales))

You are only able to replace this with a set expression if you find a key that returns for each combination of your tableX columnY values a unique answer.

Not applicable
Author

Thanks Swuehl. Great help