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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Apply one specific value to all rows

I need to add a single value for each and every row (EOD_ADJ). But when I try to join all I get is a bunch synthetic keys.

Any ideas how to do it?

LOAD Distinct
     
[INSERTION DATE],
    
TIME,
    
[FLOW TYPE],
    
AMOUNT,
    
date([FLOW EFFECTIVE DATE]) as [FLOW EFFECTIVE DATE],
    
date([FLOW MATURITY DATE]) as [FLOW MATURITY DATE],
    
Date([FLOW EFFECTIVE DATE] + IterNo() -1 ) as DATE,
    
TEXT
FROM
[Log 2.1.xlsm]
(
ooxml, embedded labels, table is TRANSACTIONS)
While [FLOW EFFECTIVE DATE] + IterNo() -1 <= [FLOW MATURITY DATE];


Right join LOAD
    
I AS EOD_ADJ
FROM
[Log 2.1.xlsm]
(
ooxml, no labels, table is [Holidays Etc])
WHERE RecNo() > 1 AND RecNo() < 3; 

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

TMP:

Right join LOAD
    
I AS EOD_ADJ
FROM
[Log 2.1.xlsm]
(
ooxml, no labels, table is [Holidays Etc])
WHERE RecNo() > 1 AND RecNo() < 3; 

Let myVar = Peek('EOD_ADJ', 0, 'TMP');

LOAD Distinct
     
[INSERTION DATE],
    
TIME,
    
[FLOW TYPE],
    
AMOUNT,
    
date([FLOW EFFECTIVE DATE]) as [FLOW EFFECTIVE DATE],
    
date([FLOW MATURITY DATE]) as [FLOW MATURITY DATE],
    
Date([FLOW EFFECTIVE DATE] + IterNo() -1 ) as DATE,
    
TEXT,

     $(myVar) as EOD_ADJ

FROM
[Log 2.1.xlsm]
(
ooxml, embedded labels, table is TRANSACTIONS)
While [FLOW EFFECTIVE DATE] + IterNo() -1 <= [FLOW MATURITY DATE];


View solution in original post

12 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try with a Left Join and let me know

Not applicable
Author

When trying left join, same result occurs, from what I can see..

alexandros17
Partner - Champion III
Partner - Champion III

There is a very simple way:

LOAD Distinct
     
[INSERTION DATE],
    
TIME,
    
[FLOW TYPE],
    
AMOUNT,
    
date([FLOW EFFECTIVE DATE]) as [FLOW EFFECTIVE DATE],
    
date([FLOW MATURITY DATE]) as [FLOW MATURITY DATE],
    
Date([FLOW EFFECTIVE DATE] + IterNo() -1 ) as DATE,
    
TEXT,

     'I' AS EOD_ADJ

Not applicable
Author

Thanks Alessandro

'I' AS EOD_ADJ is loaded from another sheet and it is a single cell, not a table.

So Im not sure how you mean

swuehl
MVP
MVP

You don't get any synth keys without the last join?

Could you post a screenshot of you data model and your script or document log?

Not applicable
Author

As I can see from where condition, it's a single value so you can store it in variable and then add with table.


alexandros17
Partner - Champion III
Partner - Champion III

But the value for I is Always the same, isn't it?

It is a unique value, a constant?

Not applicable
Author

No It changes every day unfortunately

alexandros17
Partner - Champion III
Partner - Champion III

Ok but when you try to add the new column to the table the value is only one?