Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
naveen341
Creator
Creator

comparing Field Values in an if statement

Hi

I Have a field 

Tickers :

AAA

ACB

BCG

CDG

 

 

Suppose if a user select particular tickets lets say AAA i want to perform the measure like sum({<Ticker={'AAA'}>}Sales).

this would be in a qliksense line chart

If a user says more than one field values i am expecting multiple line in the line chart how can this be acheived?

I Am looking for if condition like getfieldselection(Ticker).But if multiple selected in differnet order this is not working

 

Any help would be appreciated

 

 

 

 

Labels (3)
14 Replies
dplr-rn
Partner - Master III
Partner - Master III

as i understand you want the individual ticker line only if a ticker is selected. Else you show just the total line. Is that right?
if so Why dont you add ticker as a dimension? and Enable it conditionally e.g. GetSelectedCount(Ticker)>0

naveen341
Creator
Creator
Author

I Am trying to do it in Qliksense using an extenison where i dont have a conditional dimenison.
So i would like to write an if condition and put the measure value,
getfield values(Ticker)=AAA,ACB
BUt how can i implement if condition for measure
dplr-rn
Partner - Master III
Partner - Master III

Ah.. i just saw the qlik sense part. You posted on the qlikview forums hence the confusion.

May not be a perfect solution but below should work
add dimension
=If(GetSelectedCount(Ticker)>0,Ticker)

naveen341
Creator
Creator
Author

Sorry .i want to compare field values and then perform my measure based on field value .Not the count
dplr-rn
Partner - Master III
Partner - Master III

What do you mean by not count? I am not displaying count
The calculated dimension I mentioned will be enabled only if 1 or more ticker is selected. I.e. you will get lines for those tickers on your chart.
naveen341
Creator
Creator
Author

Each ticker has different Measure.
if(Getfieldvalue(Ticker)='ABC',min(Sales),Null),
If multiple field values are selected how can i write the above if condition.
dplr-rn
Partner - Master III
Partner - Master III

Ok. So you are not displaying same measure for different tickers.i.e. e.g. for ticker abc it maybe count and got ticker xyz it maybe sum.
Did I get that right?
naveen341
Creator
Creator
Author

yes
dplr-rn
Partner - Master III
Partner - Master III

In that case of the top of my head.
you maybe able to use concat(ticker) to get the full list of possible values for ticker and use string functions to check if e.g. and exists there. And use get selected count to ensure at least 1 is selected

Replying from phone so forgive typos