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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If or where in a chart expression

If([Pledge Campaign Year]<[Gift Campaign Year], sum([Gift Amount]), Null())

Trying to use this code in a chart expression to sum only the gifts that have a campaign year < pledge campaign year but it isn't working.

12 Replies
swuehl
MVP
MVP

Well, I assume you can only filter your records using both tables after the JOIN has happened. So first join the two tables, then do a RESIDENT LOAD with the WHERE clause.

Not applicable
Author

I am a newbie.  So I do the join without the where then how do I do the resident load?

swuehl
MVP
MVP

Just like the other resident loads in your script.

Something along this snippet:

// load first table

Table1:

LOAD  Key,

           Field1

FROM YourTable1Source;

// join second to first

LEFT JOIN (Table1)

LOAD

        Key,

        Field2

FROM Yourtable2Source;

Result:

NOCONCATENATE           // prevent QV from autoconcatenating

LOAD Key, Field1, Field2

RESIDENT Table1

WHERE Field1 < Field2;     // use your filter

DROP TABLE Table1;