Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
anil480961
Contributor
Contributor

Calculated Dimension issue in Straight Table

Hi,

  I have a straight table with multiple dimensions and a single expression, here I am trying to create a calculated dimension (Cust Number) to filter the data based on filter selection (Vehicle_Use). What I am trying to get is when we select a value (here LEASE) from Vehicle_Use filter then the straight table data along with the Cust Number filed should be filtered with two customer numbers only i.e. 699999,699998 and if we clear the filter which means if we don't select anything from the same filter it should display all the Cust Numbers in the straight table.

     

                               I have created a calculated dimension using below code to get what am looking, but its not working as expected, so i hope some one can help with below calculated dimension expression.    

Calculated Dimension:

Aggr(Only({<Vehicle_Use={'LEASE'},Current_Cust_Number={'699999','699998'}>} Current_Cust_Number), Current_Cust_Number)


Expression:

=if(Vehicle_Use = 'LEASE',

count(DISTINCT{<Current_Cust_Number ={'699999','699998'}>}Unit_Number),

count(DISTINCT Unit_Number))

1 Solution

Accepted Solutions
sunny_talwar

The if statement in your chart was wrong... try this

=if(GetFieldSelections(Vehicle_Use) ='LEASE'

View solution in original post

5 Replies
sunny_talwar

Since you are handling this in your expression, why do you need a calculated dimension? Why can't you just use Current_Cust_Number as your dimension?

anil480961
Contributor
Contributor
Author

Sunny,

      What is happening with the above expression and Current_Cust_Numeber as dimension is,  it is working fine when we select Lease from the filters but when we clear the filter straight table row count is not matching with my source system count.

So I tired to use a above cal dimension which is also not giving expected result and i have tried below expression as well, any thoughts?

=if(GetFieldSelections(Vehicle_Use='LEASE'), Count(DISTINCT{<Current_Cust_Number ={'699999','699998'}>}Unit_Number),

Count(DISTINCT Unit_Number))



sunny_talwar

Difficult to know what might be going on... are you able to share a sample where we can see this problem?

anil480961
Contributor
Contributor
Author

stalwar1‌ Please find the attached sample file

sunny_talwar

The if statement in your chart was wrong... try this

=if(GetFieldSelections(Vehicle_Use) ='LEASE'