Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
salezian
Creator
Creator

formatting interval

Dear Qlik Gurus,

How can I apply +/- sign for interval format (just like for numbers) ?

Thanks in advance.

M.

10 Replies
Anil_Babu_Samineni

Where it should be, What you are going to have by end?

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
zahidrahim_ocp
Partner - Creator
Partner - Creator

Please explain your requirement in detail, Preferably by an example.

salezian
Creator
Creator
Author

Ok. I'm counting working time. Some components of the final balance can be positive or negative. So what I'd like to achieve at the end is something like that +14:34 or -02:22.

BR.

Anonymous
Not applicable

=num(54-48,'+#,##0;-#,##0') or =num(48-54,'+#,##0;-#,##0')  check this

uacg0009
Partner - Specialist
Partner - Specialist

Hi Marcin,

Do you mean, if the filed name is test1, and there is a value "14:34" in it. And the output that you want is "+ 14:34"?

If not, could you please give some example data, and the results that you want?

Thanks

Aiolos

Anonymous
Not applicable

Hi Marcin,

Good Day.

Could you please provide an example as your query is not clear.

salezian
Creator
Creator
Author

Hi Aiolos,

Exactly. As input I have number of hours let's say 245 then I convert it to days simply 245/24 =10,24 then I'm using function interval to display it as 10 05:45 (dd hh:mm) and what I'd like to have is + for positive values and - for negative like +10 05:45 or -05 02:34.

BR

M.

uacg0009
Partner - Specialist
Partner - Specialist

Hi Marcin,

I found a way to do that, hope that's what you want, you can see my example below.

But I think it may have better way to do that.

formatting interval.PNG

Thanks

Aiolos

Anonymous
Not applicable

try this on Aiolos sample qvw file

Dimension :ID 

Expression:

if(Date1-Date2>0,
interval(Date1-Date2,'+D hh:mm:ss'),interval(Date1-Date2,'D hh:mm:ss'))