Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating Textbox according to if statement (condition)

Hello together,

I need some help. It is very easy to create a Textbox using a if Condition to display text.

But it only works if I select a Value.

Textbox condition:

=if(columnA='example',(if(columnB>1,'TEST')))

This wokrs fine if I select emaple wtihin the tabelchart (diagram).

Is it posible to get a result within the Textbox without a selection using if statement (condition)?

Thanks Thomas

31 Replies
israrkhan
Specialist II
Specialist II

i did not get you exactly, what and when you want to show in text box.

What is Test,

is it a value or Text?

and you can use set analysis and all other functions in text object.

Gysbert_Wassenaar

Sure, just use a different aggregation function than the implicit only function for example maxstring: =if(maxstring(columnA)='example',(if(maxstring(columnB)>1,'TEST')))


talk is cheap, supply exceeds demand
Not applicable
Author

Hello together,

thanks for your answer. Test is the shown TEXT within a Text box.

I trie to Explain it more detailed:

Sorry but I am not able to upload a example. Something ist wrong with my browser etc.

Example:

Beispieln.bmp

TableChart: Beispiel Anzeigen / Ausblenden

Includes following condition: If(SpalteA='a',If(SpalteB= 2,sum(SpalteB),0))

Result: only needed rows will be displayed if contion = true, TabelChart ist empty if conditoin = flase

1) Addtional function needed:

I need a Text box like above to show some text if the result of this condition = false (if TableChart: Beispiel Anzeigen / Ausblenden is empty)

Thanks Thomas

Marcoimp
Partner - Creator III
Partner - Creator III

Maybe you just have to use the "else" part of the if() function...

If(  SpalteA='a',

     If(SpalteB= 2,

          sum(SpalteB),0),'SOME OTHER TEXT')


What's wrong?!

M.Imperiale
Not applicable
Author

Hello,

thanks for your answer. It doesn't work.

Now allways 'SOME OTHER TEXT' will be displayed. It doesn't matter which value is in SpalteA or SpalteB in Statement below.

For example:

If(  SpalteA='f',

     If(SpalteB= 3,

          sum(SpalteB),0),'SOME OTHER TEXT')


He allways shows
'SOME OTHER TEXT'.

The second part is, that I need text if the result of this condition = false.

TableChart: Beispiel Anzeigen / Ausblenden is empty

Thanks Thomas

Marcoimp
Partner - Creator III
Partner - Creator III

You allways get "SOME OTHER TEXT" because SpalteA is allways <>'f', (as in you picture).

Include the qvw example (using the extended editor you'll find the function down right).




M.Imperiale
Not applicable
Author

Hi,

Thanks for answer. Sorry but I have no extended editor. Something is wrong with my browser: Other browsers don’t work too.

But it's possible to upload document on the QlikView page in generally.

You will find the Document under the Recource Library.

Title: Creating Textbox according to if statement (condition)


Thanks Thomas

Not applicable
Author

Hi,

I have a second problem. I tried to highlight the tap of this example in red according to a condtion. But for some reason it won't work.

Maybe you have an idea. You will find detailed information in following dicusion:

Higlight a tap (Worksheet) accroding to a condition

Thanks Thomas

swuehl
MVP
MVP

Thomas,

I don't really get what you are trying to achieve, but as mentioned above and in one of your previous threads, you can't compare a field to a single value unless there is only one possible value for that field

SpalteA = 'f'

What are you expect QV to return here? SpalteA is an field (or a vector / array) that contains 5 values, so QV don't know how to evaluate this comparison unless you select a value in SpalteA.

You can add some aggregation functions to get around this, like suggested above or maybe like

=concat( If(SpalteA = 'f', 'Some Text'))