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: 
user-azadi
Contributor III
Contributor III

Condition value in set analysis with use of search field in other table

Hi Friends

I have two table same below:

//------------------------------------------------

GacBranch:

LOAD * INLINE [

    Branch, Level6

    1600, 001181600

    1610, 001181610

    1611, 001181611

    1612, 001181612

];

Voucher:

LOAD * INLINE [

    Branch, Sixth, Price

    1600, 001181611, 100

    1600, 001181600, 200

    1600, 001181612, 250

    1600, 001181611, 150

    1611, 001181600, 300

    1611, 001181612, 350

    1611, 001181611, 50

    1610, 001181610, 250

];

//------------------------------------------------

i want use straight table with this :

dimension = Branch

Expression =  Sum(Price)


but i want use set analysis condition , that sum price when (Sixth and Branch field value in Voucher table, not exist in Branch and Level6 field value in GacBranch table)

my result that i expected is:


Branch       sum(Price)

1600           500

1611            650

1610            0



please help me how i can do it?

3 Replies
vishsaggi
Champion III
Champion III

Try this?

GacBranch:

LOAD *, Branch&Level6 AS Key1 INLINE [

    Branch, Level6

    1600, 001181600

    1610, 001181610

    1611, 001181611

    1612, 001181612

];

LEFT JOIN

Voucher:

LOAD *, Branch&Sixth AS Key2 INLINE [

    Branch, Sixth, Price

    1600, 001181611, 100

    1600, 001181600, 200

    1600, 001181612, 250

    1600, 001181611, 150

    1611, 001181600, 300

    1611, 001181612, 350

    1611, 001181611, 50

    1610, 001181610, 250

]WHERE NOT Exists(Key1, Branch&Sixth);

Capture.PNG

user-azadi
Contributor III
Contributor III
Author

ok , but can we use set analysis directly , without use filter in edit script?

antoniotiman
Master III
Master III

May be

Sum(If(Sixth <> Level6,Price))

Regards,

Antonio