Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis - union

Both the below expressions are working for me while trying to filter some records in a straight table.

only({<[StartDate]={"<=$(vStartDate)"}>}[bkgno]) * only({<[EndDate]={">=$(vStartDate)"}>}[bkgno])

only({<[StartDate]={"<=$(vEndDate)"}>}[bkgno]) * only({<[EndDate]={">=$(vEndDate)"}>}[bkgno])

I need to concatenate the results obtained through these two expression. I tried

(only({<[StartDate]={"<=$(vStartDate)"}>}[bkgno]) * only({<[EndDate]={">=$(vStartDate)"}>}[bkgno])) +

(only({<[StartDate]={"<=$(vEndDate)"}>}[bkgno]) * only({<[EndDate]={">=$(vEndDate)"}>}[bkgno]))

but it is not working, I am not getting results as expected.

Records with StartDate > vStartDate and those with EndDate < vEndDate is not getting displayed after using the union operator. 

How to go forward for getting union of the above two separate results ?

1 Reply
Miguel_Angel_Baeyens

Hi,

If you mean you want to see those values that match both set modifiers, I'd try the following

(only({<[StartDate] = {"<=$(vStartDate)"} >} [bkgno]) * only({< [EndDate] = {">=$(vStartDate)"} >} [bkgno])) &

(only({<[StartDate] = {"<=$(vEndDate)"} >} [bkgno]) * only({< [EndDate] = {">=$(vEndDate)"} >} [bkgno]))

Using the "&" instead of the "+" to concatenate. Anyway it would be very helpful if you upload some sample data to see what you want to get.

Hope that helps

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica