Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Linking calculated fields

Hi,

I have a calculated field which I am trying to join with a Date field so that I might see it by date. Despite, both the fields used in the calculation being linked to a date field, I can't find a way to get the calculated field by date. The script I'm using is below:

CalculatedFields:
LOAD
Date,
SUM(Alpha* Beta) AS Charlie
RESIDENT SecurityData
group by
Date,
ProductID,

Alpha,

Beta

Charlie,

Delta

etc;

Any ideas how I can get the two to link?

1 Solution

Accepted Solutions
maxgro
MVP
MVP

I think this: you only have the Date field as non aggregated field, so you need to group by Date

CalculatedFields:
LOAD
Date,
SUM(Alpha* Beta) AS Charlie
RESIDENT SecurityData
group by
Date;

View solution in original post

7 Replies
maxgro
MVP
MVP

I think this: you only have the Date field as non aggregated field, so you need to group by Date

CalculatedFields:
LOAD
Date,
SUM(Alpha* Beta) AS Charlie
RESIDENT SecurityData
group by
Date;

swuehl
MVP
MVP

Could you elaborate with some sample data lines of SecurityData (could be mock up data, but the structure should be comparable)?

Not applicable
Author

Worked perfectly, thanks so much!

Not applicable
Author

As a follow up question, how can I group by fields in another resident table?

maxgro
MVP
MVP

in this script you're already group by  from a table (SecurityData)

and the result is a new table (CalculatedFields)

CalculatedFields:
LOAD
Date,
SUM(Alpha* Beta) AS Charlie
RESIDENT SecurityData
group by  Date;

maybe I don't understand your question

Not applicable
Author

Apologies, I have loaded in two tables SecurityData and a second called SecurityCharacteristics which contains a field, for instance, of Region.

I want to be able to sort my calculated field by Region.

maxgro
MVP
MVP

in Qlik you can sort (or group by) fields in one table

if you need to sort (or group by) fields from 2 tables, first you have to join the tables in a a new one

then do a resident load (with sort or group by) from the new one