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: 
hamzabob1
Partner - Contributor III
Partner - Contributor III

Show only those rows which contain value...

Hello all,

I have one problem can u please help me out.

my Question is:-

Item, Sales, Budget

A1, 100, --

A2, 200, --

A3, 300, --

A4, 200, --

A1, --, 90

A2, --, 150

A3, --, 300

Now I want to fetch the Items, whose Sales and Budget is presented.

The result should be: A1, A2, A3 [A4 – doesn’t have any budget].

thanks in advance.

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

If You want to use within chart

LOAD all rows

in Chart Calculated Dimension

=Aggr(If(Sum(Sales) > 0 and Sum(Budget) > 0,Item),Item)

Regards,

Antonio

View solution in original post

9 Replies
sunny_talwar

Try this in a text box object:

=Concat(DISTINCT {<Item = {"=Count({<Sales = {'*?'}>}Sales) = Count({<Budget = {'*?'}>}Budget)"}>} Item, ',')

Ouput:

Capture.PNG

HTH

Best,

Sunny

sunny_talwar

swuehl‌ putting my new knowledge to work here .

antoniotiman
Master III
Master III

Hi,

if You want rows filtered in Script, try

LOAD *

Where Sales > 0 and Budget > 0;
LOAD DISTINCT
Item,Sum(Sales) as Sales,Sum(Budget) as Budget
Group By Item;
Load *
Inline [
Item, Sales, Budget
A1, 100, --
A2, 200, --
A3, 300, --
A4, 200, --
A1, --, 90
A2, --, 150
A3, --, 300
A5, --, 500
]
;

Regards,Antonio

antoniotiman
Master III
Master III

If You want to use within chart

LOAD all rows

in Chart Calculated Dimension

=Aggr(If(Sum(Sales) > 0 and Sum(Budget) > 0,Item),Item)

Regards,

Antonio

Anonymous
Not applicable

Table:

load

Item,

Sales,

Budget

where Sales>0

and  Budget>0

;

load

Item,

sum(Sales) as Sales,

sum(Budget) as Budget

Group by

Item

;

LOAD * Inline [

Item, Sales, Budget

A1, 100,

A2, 200,

A3, 300,

A4, 200,

A1, , 90

A2, , 150

A3, , 300

]

Anonymous
Not applicable

Another approach i would do is, load Item and Sales first where len(Sales)> 0 and load Item and Budget where len(Budget)>0. Then join those two tables. You will get the right data in the script itself.

maxgro
MVP
MVP

=Concat(DISTINCT {<Item={"=sum(Sales)<>0"}*{"=sum(Budget)<>0"}>} Item, ',')

hamzabob1
Partner - Contributor III
Partner - Contributor III
Author

hii sunindia,

its not working in listbox...

i want to show required output in listbox insted of textbox...

thanks in advance...

hamzabob1
Partner - Contributor III
Partner - Contributor III
Author

Thanks for useful information ANTONIO MANCINI..

Thanks...