Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
berryandcherry6
Not applicable

Display String based on conditional Statement.

Hi,

I need to display String 'TRD' based on conditional Statement (If Statement) in table.

My expression is : if(sum(sales)=0,'TRD',sum(sales))

But it shows nothing. How could i display string in Table.

Regards,

Supriya

8 Replies
Chanty4u
Not applicable

Re: Display String based on conditional Statement.

Hi,

your expression is working for me.

trd.PNG

jayaseelan
Not applicable

Re: Display String based on conditional Statement.

Hi Supriya,

      if(sum(sales)=0,'TRD',sum(sales))  this expression is working fine. I think there is problem on your data. make verify the sum(sales) = 0 is available.

Thanks,

berryandcherry6
Not applicable

Re: Display String based on conditional Statement.

Hi,

Its Strange, if i use simply like that its working, but if i use as below

Num(if(Metrics='Invitations',if(count({$<DateType= {'invitation'},

client_id={'15'}>} invitation_id)=0,'TRD',9)),if(Metrics='Completions Rate','#,##0.0%',if(Metrics='Revenue', '$ #,##0.00')))

It gives me '-' (hyphen). Its because of Using Num. What could i do for this?

jayaseelan
Not applicable

Re: Display String based on conditional Statement.

Except Num conversion  Did you got your desired output? ?

Please upload example qvf file for more clarity.

Chanty4u
Not applicable

Re: Display String based on conditional Statement.

try to check the  expression in text object. by that  you will get to know where your wrong.

berryandcherry6
Not applicable

Re: Display String based on conditional Statement.

HI,

Here according to my data: if(count({$<DateType= {'invitation'},client_id={'15'}>} invitation_id) = 0

This gives me 'Value' in textbox.

if(count({$<DateType= {'invitation'},client_id={'15'}>} invitation_id)=0,'Value',9)

But this doesnot, It gives empty or blank

Num(if(count({$<DateType= {'invitation'},client_id={'15'}>} invitation_id)=0,'Value',9),'#,##0.0%')

Its because i am applying Num format in my equation

berryandcherry6
Not applicable

Re: Display String based on conditional Statement.

HI,

Yes, Except  Num conversion i am getting desired output

sasiparupudi1
Not applicable

Re: Display String based on conditional Statement.

The reason for this is you are returning strings as input to the num function.

Num is a formatting function .You can not input format as a number as you are doing in your if conditions

qlik Help->Num( A, '#,##0.0%')    where A=35648.375