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

Define Ranges in Textboxes

Hi together,

how can simply define quality ranges ?

I have a long formula like that calculate the qualitylevel from 0 to 100 

= if (num(100 - (Count(DISTINCT{<FIELDVALIDATION={'invalid'}>}[HEL_DATA_Flight ID])/ count(DISTINCT [HEL_CAMPAIGN_Flight ID]) * 100),'0,000')

How can i get a Textresult that depends on the value which was above calculated.

Example: The above long term be variable X

X      >     69       AND     X      <      93,31 Textoutput Qualitylevel sigma 2

X      >     93,31  AND      X      <      99,31  Textoutput Qualitylevel sigma 3

X      >     99,31  AND      X      <      99,97  Textoutput Qualitylevel sigma 4

any idea ?

Thank you !

1 Solution

Accepted Solutions
qliksus
Specialist II
Specialist II

hi

Try like this in the text object

=if( $(x)>69 AND $(x) < 93.31,       'output Qualitylevel sigma 2') & '  

' &
if( $(x)>93.31 AND $(x)< 99.31 , 'output Qualitylevel sigma 3')   & '

' &

if( $(x) >99.31 AND $(x)< 99.97,  'output Qualitylevel sigma 4')

View solution in original post

7 Replies
its_anandrjs

Hi.

To achieve this you need to put the condition in X variable and use to check this condition

X >69 AND X < 93,31       output Qualitylevel sigma 2

X >93,31 AND X < 99,31  output Qualitylevel sigma 3

X >99,31 AND X < 99,97  output Qualitylevel sigma 4

like put condition in variable X= if (num(100 - (Count(DISTINCT{<FIELDVALIDATION={'invalid'}>}[HEL_DATA_Flight ID])/ count(DISTINCT [HEL_CAMPAIGN_Flight ID]) * 100),'0,000')

and check this with

$(X) >69 AND $(X) < 93,31       output Qualitylevel sigma 2

$(X) >93,31 AND $(X) < 99,31  output Qualitylevel sigma 3

$(X) >99,31 AND $(X) < 99,97  output Qualitylevel sigma 4

Regards

Anand

Not applicable
Author

Hi Anand,

how can i put this condition into a variable ? Let and Set didnt work !

Thank you!

Best Regards,

Hon

Not applicable
Author

Hello QV Community,

are there objects in a way to define a classic switch statement ?

If so, how it looks? In the documentation I have found a switch statement, but unfortunately only for sql

Thank you.

its_anandrjs

Hi,

Create a variable from variable window by pressing Ctrl+Alt+V and add a variable there and put your test condition there by writing or copy paste over there in Definition window.

Regards

Anand

qliksus
Specialist II
Specialist II

hi

Try like this in the text object

=if( $(x)>69 AND $(x) < 93.31,       'output Qualitylevel sigma 2') & '  

' &
if( $(x)>93.31 AND $(x)< 99.31 , 'output Qualitylevel sigma 3')   & '

' &

if( $(x) >99.31 AND $(x)< 99.97,  'output Qualitylevel sigma 4')

its_anandrjs

Hi,

You also try some thing like this to check your values for the conditions

=If ( $(X) >69 AND $(X) < 93,31, 'output Qualitylevel sigma 2',

  If ( $(X) >93,31 AND $(X) < 99,31, 'output Qualitylevel sigma 3',

  If ( $(X) >99,31 AND $(X) < 99,97,  'output Qualitylevel sigma 4')))

Regards

Anand

Not applicable
Author

Thank you