Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

bashdown
New Contributor

dual function, avg by numeric value, display text string?

Sorry for multiple questions – I have spent a long time looking for answers to these before posting.  Thanks in advance for you time and patience.

I have below a section of a larger nested if() statement that I'm using as a measure on a line graph.  What I am trying to do is to use the dual() function assign a text and numeric value to each average.  I would like to plot my graph according to the numeric value, but have the labels show the text string.  Is this possible?

if(avg([Diff Value])<11.6 and avg([Diff Value])>=11.4,dual('5.11b', 11.4),

  if(avg([Diff Value])<11.8 and avg([Diff Value])>=11.6,dual('5.11c',11.6),

     if(avg([Diff Value])<12 and avg([Diff Value])>=11.8,dual('5.11d',11.8),

          dual('5.12a',12.2)

        )

      )

   )

Thanks again,

Brayden

Tags (1)
1 Solution

Accepted Solutions
xufei123
Valued Contributor

Re: dual function, avg by numeric value, display text string?

Change number formatting to Measure expression:

9 Replies
xufei123
Valued Contributor

Re: dual function, avg by numeric value, display text string?

It should work. What is the problem?

bashdown
New Contributor

Re: dual function, avg by numeric value, display text string?

I'm not sure – how to you make it report the text string as a label?  It works to use the numeric value to create an average, but the label for each data point and the axis are also numeric values and not the text string. 

Is what I want to do possible, or will the text string only show up in a table or some other place that expects strings?

pradosh_thakur
Valued Contributor III

Re: dual function, avg by numeric value, display text string?

would you be able to share a sample ?

regards

Pradosh

bashdown
New Contributor

Re: dual function, avg by numeric value, display text string?

Here is what I was working with – this is just some made up data, but it is the actual implementation I was looking for.  Specifically in the top left combo chart, I would like the average grade climbed to be calculated using the nested if()s, but was hoping to use the text string as a label.

xufei123
Valued Contributor

Re: dual function, avg by numeric value, display text string?

Change number formatting to Measure expression:

bashdown
New Contributor

Re: dual function, avg by numeric value, display text string?

That's amazing.  And very simple.  Thank you for taking the time to help me along as I teach myself.

rajeshthakur292
Contributor II

Re: dual function, avg by numeric value, display text string?

Hi Fei Xu,

Why can't i see the the Measure Expression option in the Number formatting tab?

Regards,

Rajesh

xufei123
Valued Contributor

Re: dual function, avg by numeric value, display text string?

Try using the new version Sep 2017.

rajeshthakur292
Contributor II

Re: dual function, avg by numeric value, display text string?

Okay.

I thought that this feature would be available on all the versions!

Regards,

Rajesh