Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
mapratt82
Contributor

Max Value in Load Script

I need to load the following with the Max EOD value for each Tax ID, help please:

LOAD

  "Tax_ID_Number" as "Tax ID",

    "EOD";

SQL SELECT "Tax_ID_Number",

    "EOD"

FROM "data".dbo."Source";

Thanks in advance!

Tags (1)
1 Solution

Accepted Solutions

Re: Max Value in Load Script

May be like this:

Table:

LOAD "Tax ID",

          Max(EOD) as EOD

Group By [Tax ID];

LOAD

  "Tax_ID_Number" as "Tax ID",

    "EOD";

SQL SELECT "Tax_ID_Number",

    "EOD"

FROM "data".dbo."Source";

5 Replies

Re: Max Value in Load Script

May be like this:

Table:

LOAD "Tax ID",

          Max(EOD) as EOD

Group By [Tax ID];

LOAD

  "Tax_ID_Number" as "Tax ID",

    "EOD";

SQL SELECT "Tax_ID_Number",

    "EOD"

FROM "data".dbo."Source";

mov
Esteemed Contributor III

Re: Max Value in Load Script

Table:

LOAD

  "Tax_ID_Number" as "Tax ID",

    "EOD";

SQL SELECT "Tax_ID_Number",

    "EOD"

FROM "data".dbo."Source";

LEFT JOIN LOAD

     max(EOD) as MaxEOD,

     "Tax ID"

RESIDENT Table

GROUP BY "Tax ID";

shraddha_g
Honored Contributor III

Re: Max Value in Load Script

Try this.

Tax:

SQL SELECT "Tax_ID_Number",

EOD

From "data". "dbo". "source" ;

Final:

Load max(EOD)  as Max_EOD,

"Tax_ID_Number"

Resident Tax

Group by Tax_ID_Numbern

Drop table Tax;

mapratt82
Contributor

Re: Max Value in Load Script

This seems to be correct and the easiest fix. Thanks everyone!

Re: Max Value in Load Script

Just another though, you might be able to do this in your SQL statement itself

Table:

SQL SELECT

     "Tax_ID_Number" as "Tax ID",

    Max("EOD") as EOD

FROM "data".dbo."Source"

GROUP BY "Tax_ID_Number;