Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Shubham_Deshmukh
Valued Contributor

Exclude Max value product using script

Hi Qlikers,

It is quite simple but m getting confuse for this in scripts. I want to exclude max value product (D) from my list to show in straight table, I am extracting below data from excel sheet.

PRODUCTValue
A10
C20
D30
E40
E50
D90

Expected output   :

PRODUCTValue
A10
C20
E40
E50

 

Thanks

Labels (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Exclude Max value product using script

This?

T1:
Load * Inline [
PRODUCT,	Value
A,	10
C,	20
D,	30
E,	40
E,	50
D,	90];

Load
	FirstSortedValue(PRODUCT, -Value) as MaxPROD
Resident T1 ;
T2:	
NoConcatenate
Load * Resident T1 Where Not Exists(MaxPROD,PRODUCT); Drop Table T1; Drop Field MaxPROD;

 

13 Replies
MVP
MVP

Re: Exclude Max value product using script

Max in aggregate or in individual value?

Shubham_Deshmukh
Valued Contributor

Re: Exclude Max value product using script

Individual value.

If possible let me know both.

MVP
MVP

Re: Exclude Max value product using script

This?

T1:
Load * Inline [
PRODUCT,	Value
A,	10
C,	20
D,	30
E,	40
E,	50
D,	90];

Load
	FirstSortedValue(PRODUCT, -Value) as MaxPROD
Resident T1 ;
T2:	
NoConcatenate
Load * Resident T1 Where Not Exists(MaxPROD,PRODUCT); Drop Table T1; Drop Field MaxPROD;

 

Shubham_Deshmukh
Valued Contributor

Re: Exclude Max value product using script

Thanks Tresesco for reply.
But tt is excluding Product 'E' also.
jyothish8807
Honored Contributor II

Re: Exclude Max value product using script

Hi Shubham,

You can acheive the same from UI a well, using the same logic mentioned by tressesco.

Ref attached.

Best Regards,
KC
Shubham_Deshmukh
Valued Contributor

Re: Exclude Max value product using script

Sorry Jyothish, I cannot open qvw here.
MVP
MVP

Re: Exclude Max value product using script

I got:

Capture.PNG

jyothish8807
Honored Contributor II

Re: Exclude Max value product using script

Try like this:

T1:
Load RowNo() as Si,
PRODUCT,
Value;
Load * Inline [
PRODUCT, Value
A, 10
C, 20
D, 30
E, 40
E, 50
D, 90];

In UI: Create a straight chart:

Dim1: Si

Dim2. =if(PRODUCT<>FirstSortedValue(total PRODUCT, -Value),PRODUCT)

expression:Sum(Value)

You can hide Si field from presentation tab:

Capture.PNG

Best Regards,
KC
Shubham_Deshmukh
Valued Contributor

Re: Exclude Max value product using script

Thanks @jyothish8807 , working absolutely fine but I want to do it in script.

@tresesco , it is working for table box but when I am taking PRODUCT as dimension in straight table it is not showing 'E'.xx.png