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

Conditional usage issue in barchart

Dear all,

Need your help on the below issue,

I have to display the count of records which would match the condition =If(aa > bb, count(distinct(cc)))

I have taken dimension as cc

Please let me know where i need to use this condition under the expression tab in the bar chart ??

Whether it is right below condition checkbox or under defination ??

6 Replies
migueldelval
Specialist
Specialist

Hi Remo,

Could you explain a little bit your question?

Regards

Miguel del Valle

remo0017
Contributor II
Contributor II
Author

I am trying to get the count of records based on the condition ( a > b)

If ( a > b, count(distinct(c)))

C- field is something which i have been using as a dimension

devarasu07
Master II
Master II

Hi,

is your aa, bb are measure value or dim value?

Expression:

=if( sum(Stock) > sum(OrderQty), count(DISTINCT Product_Code))

or

Count({<Product_Code ={"=sum(Stock)>sum(OrderQty)"}>}DISTINCT Product_Code)

Thanks,Deva

Anil_Babu_Samineni

What are aa and bb in your table?

Can you create one flag

Load aa, bb, cc, If(aa > bb, 1, 0) as Flag from table; // I assume, aa and bb has numbers not the characters

Then use dimensions and expression is Count({<Flag = {1}>} DISTINCT cc)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
remo0017
Contributor II
Contributor II
Author

Hi Anil,

But problem here is aa is from table1 and bb is from table2, both these tables are connected through table3 by a common fields for both the tables table1, table2.

Anil_Babu_Samineni

Even thought, If those columns coming from two tables we will achieve by help of joins or Qualify statements.

Can you provide more information related data set or achieve same from your end

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful