Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Text and numeric value in one table

Hi everyone,

I'm trying to format a straight table with numbers and text in it. Unfortunately, it doesn't show the text only " - ", the numbers work fine though.

This is my code:

=IF([Customer.Year Value 2011]>1,Num([Customer.Year Value 2011],'#.###,#'),

If([Customer.Year Value 2011]<1,Num([Customer.Year Value 2011],'###,#%'),

text([Customer.Year Value 2011])))                      --> this is not working

Many thanks!!

1 Solution

Accepted Solutions
Not applicable

Text and numeric value in one table

Ok I got it, I just changed the presentation of the Null value and set Null Value = NA

Thanks for the explanation of the if condition!!

8 Replies
kamalqlik
Valued Contributor

Text and numeric value in one table

Hi cdettmer,

                    Can you clarify more about the problem.Or you can show me the script.

regards

Kamal

Not applicable

Text and numeric value in one table

Hi Kamal,

the problem is that in the table there are severyl different data types

percentage numbers, integer numbers and text

I want to define all three types in an if condition.

So this:

" =IF([Customer.Year Value 2011]>1,Num([Customer.Year Value 2011],'#.###,#'),

  If([Customer.Year Value 2011]<1,Num([Customer.Year Value 2011],'###,#%'),      "

defines the numeric values.

But unfortunately now the text isn't recognized as text anymore. instead of NA what is supposed to stand there, only the sign " - " is shown.

Sorry but I can't show you the script

kamalqlik
Valued Contributor

Text and numeric value in one table

Can you give a liyyle bit example of each datatype.

ie Number,text....so that I can identify your problem

mwoolf
Honored Contributor II

Text and numeric value in one table

Am I reading your expression correctly?:

=IF([Customer.Year Value 2011]>1,'what to do if >1',

If([Customer.Year Value 2011]<1,'what to do if < 1','

'what remains is what to do if =1'))  

Not applicable

Text and numeric value in one table

=IF([Customer.Year Value 2011]>1,'what to do if >1',

If([Customer.Year Value 2011]<1,'what to do if < 1','

yes this is right but as the third expression what I want to express is:

'what remains is text'))

e.g. my table looks loke this

a     9%

b     2,1

c     NA

a and b works but c is displayed as follows:

c     -

Thanks for your help!!!


mwoolf
Honored Contributor II

Text and numeric value in one table

It is not c that is displayed as "-", it is Customer.Year Value 2011 = 1.

There are no values =1. the - is the null symbol.

You need to rethink your IF statment.

Not applicable

Text and numeric value in one table

Ok I tried this

=IF([Customer.Year Value 20111]>1,Num([Customer.Year Value 20111],'#.###,#'),If([Customer.Year Value 20111]<=1,Num([Customer.Year Value 20111],'###,#%'),

if(istext([Customer.Year Value 2011]),text([Customer.Year Value 2011]))))

But it's not working either

Not applicable

Text and numeric value in one table

Ok I got it, I just changed the presentation of the Null value and set Null Value = NA

Thanks for the explanation of the if condition!!