Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Merge of two fields from FACT table

Hello Community,

I'm currently asking myself how I can merge two flag fields from my FACT Table?

Within my Script I create two separate flags depending on different conditions and stored both of them into my FACT table as  FLAG1 and FLAG2. he value of the both flag fields is either 1 or it's empty. Now I want to merge both flags into one field.

The result should be also the value 1 or if the conditions is wrong it should stay empty.

I tried to solve this with the below formula. But the result duplicates the records within my fact table?

left join (FACTS) LOAD DISTINCT
if( (FLAG1 = 1  or FLAG2 = 1)
, 1)
as FLAG  
resident FACTS; 

Has anyone an idea?

Many thanks in advance and best regards,

Claus

1 Solution

Accepted Solutions
sunny_talwar

Instead of doing a left join.... just do this in your Fact Table

Fact:

LOAD ....,

    FLAG1,

    FLAG2,

    If(FLAG1 = 1 or FLAG2 = 1, 1) as DOPPELBESUCH_FLAG

FROM ...;

View solution in original post

2 Replies
sunny_talwar

Instead of doing a left join.... just do this in your Fact Table

Fact:

LOAD ....,

    FLAG1,

    FLAG2,

    If(FLAG1 = 1 or FLAG2 = 1, 1) as DOPPELBESUCH_FLAG

FROM ...;

Anonymous
Not applicable
Author

Many thanks Sunny!

That was the crucial hint. 🙂