Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to compare two calculated dimensions

HI

how can we use Master item (dimension) in calcuating another master item as comparing if one master item value is greater . than another master item value then 1 else 0

can we use as above

22 Replies
Anonymous
Not applicable
Author

hi

i have numerical values and tried your syntax. it is not throughing any error but it is brining else part even i have A value greater than B value it is not brining 0 value it is always showing 1

if($(A) > $(B), '0', '1')

d_prashanthredd
Creator III
Creator III

How come?

Is it possible to provide variable A and B expressions and values?

Anonymous
Not applicable
Author

that is my requirement

i have created two master columns A and B. These two columns having numerical values.

Now i have to compare Column A and B values if A column value is greater than B value then 1 if not 0 value have to populate in new column.

Can you help on this

agigliotti
Partner - Champion
Partner - Champion

could be easy to help you if you post a sample app.

Anonymous
Not applicable
Author

i cannot add app

can yo assist based on sample information i provided

d_prashanthredd
Creator III
Creator III

Your statement and expression differs to each other.

Statement: Now i have to compare Column A and B values if A column value is greater than B value then 1 if not 0 value have to populate in new column.

Expression: if($(A) > $(B), '0', '1')

In above statement, you are saying if A>B then 1 but in expression, you wrote it to return "0" .

Still, I'm showing real time example:

I used below expressions to achieve the values mentioned in above image.

'varA: ' & $(varMaxDate)

'varB: ' & $(varMinDate)

'if(varA > varB, 0, 1) ---> Result: ' & if($(varMaxDate) > $(varMinDate), 0, 1)

Anonymous
Not applicable
Author

if($(varMaxDate) > $(varMinDate), 0, 1), tried this

but it always gives 1, even if condition '0' satified it never showed up 0

Anonymous
Not applicable
Author

can you provide information as how greater than or less than operators for two values

atleast i will try to write all if conditions which i used in creating master items and try on that

d_prashanthredd
Creator III
Creator III

I Have created new variables and compared.. Have a look at sample app

attached

On Wed, Jul 26, 2017 at 5:02 PM, nagamani vadisala <qcwebmaster@qlikview.com

Anonymous
Not applicable
Author

i dont see any app attached here