Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ujjwalraja
Contributor III
Contributor III

QlikView Logic Implementation

Hi Qlik Team,

I have data as following

keyreceipt
10
1122
1256
20
30
3256
4586

The requirement is to fetch only those key for which no receipt has been generated. Here the output should be key 2

Please suggest logic , I have to do it in back-end.

Thanks

1 Solution

Accepted Solutions
raman_rastogi
Partner - Creator III
Partner - Creator III

May be like this

Input1:

Load * Inline [

Key   , reciept

1, 0

2, 0

3, 0

1, 122

1, 256

3, 256

4, 586

];

NoConcatenate

I2:

LOAD *, Key as Keycheck RESIDENT Input1

WHERE reciept <>0;

CONCATENATE

LOAD *, Key as Keycheck RESIDENT Input1

WHERE reciept =0  and not exists(Keycheck,Key);

NoConcatenate

Load

Key ,reciept Resident I2 where reciept=0;

Drop table Input1;

Drop table I2;

Regards

Raman

View solution in original post

7 Replies
vamsee
Specialist
Specialist

LOAD

          *

From Table

Where

Num(receipt) > 0;

ujjwalraja
Contributor III
Contributor III
Author

This will give 1,3 and 4

Anil_Babu_Samineni

You want this in Script / UI?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
ujjwalraja
Contributor III
Contributor III
Author

script

vamsee
Specialist
Specialist

Maybe try

Source:

LOAD * Inline [

    key, receipt

    1, 0

    1, 122

    1, 256

    2, 0

    3, 0

    3, 256

    4, 586

    

];

Min:

LOAD key as Key_Check

Where minvalue=0;

LOAD

key,

min(receipt) as minvalue

Resident Source

Group by key;

Final:

NoConcatenate

LOAD

*

Resident Source

Where Not Exists (Key_Check, key);

Drop Tables Min, Source;

raman_rastogi
Partner - Creator III
Partner - Creator III

May be like this

Input1:

Load * Inline [

Key   , reciept

1, 0

2, 0

3, 0

1, 122

1, 256

3, 256

4, 586

];

NoConcatenate

I2:

LOAD *, Key as Keycheck RESIDENT Input1

WHERE reciept <>0;

CONCATENATE

LOAD *, Key as Keycheck RESIDENT Input1

WHERE reciept =0  and not exists(Keycheck,Key);

NoConcatenate

Load

Key ,reciept Resident I2 where reciept=0;

Drop table Input1;

Drop table I2;

Regards

Raman

snehamahaveer
Creator
Creator

Hello Ujjwal,

I would suggest loading like

Load

Key,

sum(Receipt) as Total

from table

Group by Key;

and then do

Table 2:

Load

Key

Resident table

where Total = 0;

Hope this helps.

Regards

Sneha