
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How I add a constant in a table?
Hi everyone, i'm looking for a solution in this case:
I have this table:
Sales:
Load
sales,
customer,
location
FROM ...;
Example:
[Sales-Customer-Location
100 A MIT
200 b NY]
Previously I calculate the workdays of the last three months, and i sum this days and save it in a field. I save this result in this table:
workdays:
load
Sum(workdays) as workdays_sum
from ...;
Example:
[workdays_sum
62]
When I use Concatenate function, the result is this:
[Sales-Customer-Location-workdays_sum
100 A MIT -
200 b NY -
- - - 62]
Who is the best way to have this result:
[Sales-Customer-Location-workdays_sum
100 A MIT 62
200 b NY 62]
I apretiate all comments and help.
Thanks
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, you can do an outer join , which will create a cartesian products between all values in both tables:
Outer Join (Sales)
load
Sum(workdays) as workdays_sum
from ...;
Another option is to load days in a variable:
LET vWorkDays = Peek('workdays_sum',0,'workdays');
And use this variable on LOAD:
Load
sales,
customer,
$(vWorkDays) as workdays_sum,
location
FROM ...;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, you can do an outer join , which will create a cartesian products between all values in both tables:
Outer Join (Sales)
load
Sum(workdays) as workdays_sum
from ...;
Another option is to load days in a variable:
LET vWorkDays = Peek('workdays_sum',0,'workdays');
And use this variable on LOAD:
Load
sales,
customer,
$(vWorkDays) as workdays_sum,
location
FROM ...;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Gracias Ruben, muy util tu ayuda.
Saludos
