Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Number format in dual expression

Hi,

I'm working on a bar chart where the bar chart expression is something like this dual(int,string).

Here I want to format integer to #.##0 .

I tried following 2 approaches :

1. In number Tab I tried making it integer. Formatting does work but the string in dual function wont be displayed. I mean only number is displayed without string after that.

2. I tried formatting using num function. In this case expression value is formatted and even the text after number is displayed. But the problem is Y-axis value are not formatted.

Can any one please help me to format Y-axis values as well as integer in dual expression result.

Thanks in advance!!!

13 Replies
tresesco
MVP
MVP

Dual() function returns STRING to the front-end while the qv internally treats it numerically. Therefore, you can't format data numerically of a returned string. Hope this makes sense.

Not applicable
Author

As I have explained in my 1st approach number is being formatted but the text after it is not displayed.

Not applicable
Author

dual(s,x) is used in the script and is designed to apply a number representation to a string. s = string and x = number

e.g. dual('January', 1) as Month

(normally you would use a field)

see Help section

tresesco
MVP
MVP

Well, got you. Can you post a sample. From a single dual, it might not be possible in the front-end. Or, you might want to use DUAL over another DUAL to get what you want, something like:

Dual(Num(Dual(Txt, Expression), '##.00#'), Expression) as Txt_Num_Dual

Note, here the highlighted part would be treaded as text while you will see text and number both.

Not applicable
Author

I have shown my chart below:

  dual(num(Max(salary),'#.##0'), FirstSortedValue(DISTINCT [NAME], -aggr(max(salary),[Date],NAME)))

The above expression is working fine. But you can see Y-axis values(highlighted in oval) are not formatted.

tresesco
MVP
MVP

What is your dimension?

Not applicable
Author

Its category. Each category has a list of people. the person having highest salary in each category is displayed as Y-axis value along salary.

tresesco
MVP
MVP

, Please post a sample. How to prepare example for upload

Not applicable
Author

My actual qlikview file has expression of 7-8 lines. I tried making it simple and explained above. So my qlikview file has huge data and really big expressions. So there s no sample here.