Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
oliviatww
Partner - Contributor II
Partner - Contributor II

How to extract data from field?

Hi there,

Not sure how to extract data from field.

For example, I have a field called 'Numerator' and the data for this field is either 0 or 1. Now I have a list box of 3 different flag (eg a, b, c) and a chart straight table showing all the information and what I would like to do is to create an expression saying that if I click on one of the flag from the flag list box, the expression I want in the chart straight table should show field numerator 1 but not 0.

I know to use the conditional for the expression part when select any flag from the flag list box, but no idea how to extract 0 from numerator field.

Any help is appreciated.

Thanks.

6 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Not sure i understand your question correctly...what do you meant by extract 0 from field Numerator?

if your expression to show 1 when you select any element in flag list box you can use the below expression..

=if(getselectedcount(falg) >0, 1)

share example that will be helpful..

oliviatww
Partner - Contributor II
Partner - Contributor II
Author

Thanks for your reply Phaneendra, but this is not what I mean.

I have fields that are:

                              [a_NUMERATOR] - returns 0 or 1

                              [b_NUMERATOR] - returns 0 or 1

                              [c_NUMERATOR] - returns 0 or 1

I then put these 3 fields in a list box. When user select one of the field, the table expression should show information of 1 but not 0. For example, if user select [b_NUMERATOR] from the list box, then the table should show information of 1, not a string '1'.

Thanks for the explanation anyway.

Not applicable

Hi,

Try wiht something like this:

In your ecpression -> IF(GetSelectedCount(flag) > 0, Sum({<Numerator={1}>} MetricField), Sum(MetricField))

or cretate two expression  one per Sum({<Numerator={1}>} MetricField) and second for show all Numerators Sum(MetricFiled) then select expression one and select "Conditional" check box in top of Expression sheet tip GetSelectedCount(Flag)>0. Finally select second expression and select "Conditional" check box and tip GetSelectedCount(Flag)=0  (See image)

Best regards.


GetSelectedCount.png

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

It will be very easy to me if you can share a sample app.. seems you are looking for some kind of trick that needs to apply when you choose your fields from the list box.

MayilVahanan

HI

Try like this

Conditional

=if(getselectedcount(flag), 1, 0)

Expression:

Ex:

Sum({<Numerator={1}>} FieldName)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
oliviatww
Partner - Contributor II
Partner - Contributor II
Author

Hi all,

Thanks all for your reply. I found another way a simple way of working instead of this way which is complicated. But still thanks everyone.