Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
vireshkolagimat
Creator III
Creator III

specifc rows formatting in Qlikview

hi guys,

I have a table that has 10 rows and first row being the header column. Is there anyway to set different number formatting to different rows.

I need first rows values in integer format and rest in %.

Header 1Header 2Header 3
ABC3334567
PQR10.00%20.00%
LMN6.99%2.33%
XYZ67.00%12.36%

Regards,

Viresh

13 Replies
Kushal_Chawda

Can you share sample data

sunny_talwar

You can def. do this. This can be based on the dimension itself or RowNo()

If([Header 1] = 'ABC', Num(Expression, '##'), Num(Expression, '##.00%'))

or

If(RowNo() = 1, Num(Expression, '##'), Num(Expression, '##.00%'))

or some variation of both of these based on your actual data

ciaran_mcgowan
Partner - Creator III
Partner - Creator III

Hi Viresh,

Are there any distinguishing factors in any of the Header 1 names that you can identify as being a number or %? If so, I would create a flag in the script to identify this fact.

     if(Header1 = 'ABC', 1, 2)     AS Flag.Header1

Then in any of your tables, you can use something like:

     if(Flag.Header1 = 1, Num(Header2, '#,##0'), Num(Header2, '0.00%'))

vireshkolagimat
Creator III
Creator III
Author

I am using the below expression i am not getting the format.

If(cat = 'ABC', Num([42401], '##'), Num([42401], '##.00%'))

This is the sample data:

 

Cat1-Feb1-Mar
ABC100200
PQR4589
LMN7788
Digvijay_Singh

I think 'c' of Cat should be in upper case.

sunny_talwar

Make sure to select Expression Default formatting on the Number's tab of your chart properties

vireshkolagimat
Creator III
Creator III
Author

yeah i corrected it, thanks

vireshkolagimat
Creator III
Creator III
Author

I'm getting the below result

ABC 1e+002 2e+002

PQR 4500.00%  8900.00%

sunny_talwar

Try this:

=If(Cat = 'ABC', Num(Value, '##.'), Num(Value/100, '##.00%'))


Capture.PNG