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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
cyberblitz
Contributor II
Contributor II

Conditional Formatting and Variable woes

Hi,

Why does this script not work:

If(Interval(Now() - UpdateDT, 'm') >=10, '#FDA50F') 

The values produced by Interval(Now() - UpdateDT, 'm')  works fine but when i try to use it for conditional formatting it does not.

As i wanted to use this value repeatedly, I've tried to use Interval(Now() - UpdateDT, 'm')  in a variable but i get no results at all, so i have to use the code in the measure itself for it to work.

I've tried using variables like this before but they never seem to work. What am i doing wrong on both counts? 

Thanks in advanced..

Labels (2)
1 Solution

Accepted Solutions
cyberblitz
Contributor II
Contributor II
Author

I have solved it.

I had to use the NUM# function in the load script, thus:

NUM#(Interval(Now() - UpdateDT, 'm'), '0.0') as TaskDuration

View solution in original post

3 Replies
MayilVahanan
MVP
MVP

Hi @cyberblitz 

UpdateDT  <-- might be contains many values. So it doesn't work in the variable / conditional format.

Might be, You can try like 

If(Interval(Now() - Max(UpdateDT), 'm') >=10, '#FDA50F') 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
cyberblitz
Contributor II
Contributor II
Author

Thanks for your suggestion but it does not work.

I have resorted to including the script in the data load editor and yet it still does not work. I have even resorted to changing the column to a dimension from a measure and it still does not work.

Why does it not see the integer value?

cyberblitz
Contributor II
Contributor II
Author

I have solved it.

I had to use the NUM# function in the load script, thus:

NUM#(Interval(Now() - UpdateDT, 'm'), '0.0') as TaskDuration