Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

condition on the dimension field in a table

Hi All,

I have a table as follows:

IDEmp IDEmp NameSales
11000John100
21001Peter
31002Mark
41000John
51001Peter1000
61002Mark1000
71000John500

I want to create a table which will display only the 'Emp Name' which has a value in the field 'Sales'. Basically i want the output as follows:

Emp NameSales
John100
Peter1000
Mark1000
John500

Your help is much appreciated. Thanks.

12 Replies
oknotsen
Master III
Master III

Create a table, add Emp Name, add sum(Sales), be sure to select "suppress zero values".

Since this sounds like the default functionality, I wonder if I understood your question correct.

May you live in interesting times!
PrashantSangle

Hi,

as suggested by Onno this is default behaviour of qlikview,

but if you want two row of John

then you have to add ID also in your table because Sum(Sales) gives your 600 and single row

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi Ramya,

Add a Where clause while loading the data like  " WHERE(not IsNull(Sales)); " .

For example:

Employee:

LOAD ID,

     EmpName,

     Sales

FROM

<Location or Path or Database>

WHERE(not IsNull(Sales));

Hope this helps you.

Thanks,

Harika

Not applicable
Author

Ok actually i already have a calculated dimension for this table. The actual problem is i have a table 'Departments' and i have added a calculated dimension on the table to display only those departments which belong to a particular region. And then i want to add this dimension to display employees who have a value in Sales and belong to the Department to the particular region.

Once i add the calculated dimension to display employees of a Department say 'X' it is displaying all the employees of Department X. I am not able to display only the employees of this Department X with the value in 'Sales' field.

Thanks for your help, i should have been more elaborate on the question.

PrashantSangle

Hi,

Can you post sample apps which show your problem.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
oknotsen
Master III
Master III

I suggest not to use Calculated Dimensions at all. Better make those fields in script as that is better for performance.

May you live in interesting times!
ankitaag
Partner - Creator III
Partner - Creator III

Can you provide the script or sample data to understamd your problem.

Request you to write the script and not to attach the app as I don't have a liscensed version..working on personal edition.

Not applicable
Author

I may not be able to post my script. But my Department and Employee_Sales tables are as follows:

Department IDDepartment Name
Region
1SalesNA
2EngineeringSA
3MarketingNA
4AdminSA
5HRNA
6OperationsSA
7ITNA
IDEmployee IDEmp NameDepartment IDSales
110000John1100
210001Peter1
310002Mark1100
410003Jack2100
510004Mary3300
610005Irina4200
710006Amy4200
810007Rich5
910008James6500
1010009Pierre7600
1110010Shaun7100
1210011Susan7

I want the straight table to display data of only those employees who belong to the department of region 'NA' and have data in the 'Sales' field. My output should be as follows:

Department NameEmployee NameSales
SalesJohn100
SalesMark100
MarketingMary300
ITPierre600
ITSusan100

This is the exact problem statement. Your help is much appreciated, Thanks.

Not applicable
Author

I want to do this in the expressions. I cannot modify the load script for now.

Thanks.