Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Change row value

IF(LEVEL2 = '16.30' AND (len(LEVEL3 > '0')), LEVEL2, LEVEL1) AS LEVEL4

When I load this line, it will output in a pivot table showing 16.3 because in my excel sheet that I load from, 16.30 is shown as 16.3(For I don't know what reason. My company say its like that).

What I would like to do is to change the 16.3 showing in the pivot table to '16.30'. Is there any way I can do it like for example

IF(LEVEL2 = '16.30' AND (len(LEVEL3 > '0')), LEVEL2 AS '16.30', LEVEL1) AS LEVEL4?

The above code does not work btw. Thank very much

15 Replies
sdmech81
Specialist
Specialist

try

num(IF(LEVEL2 = '16.30' AND (len(LEVEL3 > '0')), LEVEL2 AS '16.30', LEVEL1)#,##0.00) as level4

Anil_Babu_Samineni

May be use Num funciton like below

Num(IF(LEVEL2 = '16.30' AND (len(LEVEL3 > '0')), LEVEL2, LEVEL1),'00.00') AS LEVEL4

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

My excel is like this

I know my excel does not contain 16.30 but as mentioned, it treats 16.3 as 16.30.(I think it is some formatting issue)

when I use this code

IF(LEVEL2 = '16.30' AND (len(LEVEL3 > '0')), LEVEL2, LEVEL1) AS LEVEL4

It works and it loads into qlikview as shown below

As you can see, 16.3 is loaded with the above code. However, I want to display it as 16.30 because my boss wants it displayed as such. How do I manually change it to show as 16.30?

stabben23
Partner - Master
Partner - Master

So then Your if statment wont work, 16.30 doesent exsist.  Try this instead.

IF(LEVEL2 = '16.3' AND (len(LEVEL3 > '0')), num(LEVEL2,'##,##'), LEVEL1) AS LEVEL4

sdmech81
Specialist
Specialist

This should work

Num(IF(LEVEL2 = '16.3' AND (len(LEVEL3) > '0'), LEVEL2, LEVEL1),'#,##0.00')  AS LEVEL4

Try!

stabben23
Partner - Master
Partner - Master

What is Your DecimalSep?

num.GIF

Is it a . or a ,?

if it is a . use this:

IF(LEVEL2 = '16.3' AND (len(LEVEL3 > '0')), num(LEVEL2,'##.##'), LEVEL1) AS LEVEL4

if it is a , use this:

IF(LEVEL2 = '16.3' AND (len(LEVEL3 > '0')), num(LEVEL2,'##,##'), LEVEL1) AS LEVEL4