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: 
wanass123
Contributor III
Contributor III

Interval with negative value

count the pending time for the ticket in retail so I'm using below Code I got for 1500 results , Approximately 1000 correct and 500 wrong with negative value , the value should be positive also when I count the date in excel give positive , below example first two result are correct and rest two result wrong with negative value . 

I didn't understand why Qlik give wrong calculation . please advice . 

NoConcatenate
RetailData:
Load *, if((History_To_Val) = 'Retail Manager ', Interval(Previous(CREATED_History)-(CREATED_History),'DD')) as Pendingdays 
Resident RetailData ;
Drop table RetailData;

 

 

History_Ticket_IDCREATED_HistoryCREATED_BY_HISTORYHistory_From_ValHistory_To_ValPending  ( Days ) 
2432421/26/2020 15:10USER 2Support TeamRetail Manager0.10
2432421/26/2020 17:38USER 1 Retail ManagerSupport Team-
2432421/27/2020 14:57USER 2Support TeamRetail Manager2.99
2432421/30/2020 14:42USER 1 Retail Manager Support Team-
2432422/2/2020 15:10USER 2Support TeamRetail Manager-8.77
2432422/3/2020 11:50USER 2Retail Manager Support Team-
2432422/4/2020 15:09USER 2Support TeamRetail Manager-0.59
2432422/5/2020 20:04USER 1 Retail Manager Support Team-
2432422/8/2020 15:06USER 2Support TeamNOC IT-
      
Labels (2)
1 Reply
marcus_sommer
MVP
MVP

You need an order by statement within your load to ensure that the data are loaded in your wanted way.

- Marcus