Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sona_sa
Creator II
Creator II

Expression Help !

Hi All,

I have the data like :

   

QVD NameQVD Size (KB)QVD Time
ata.qvd1,908.998/1/2018 12:10:30 AM
ata.qvd1,911.118/1/2018 4:25:48 AM
ata.qvd1,914.808/1/2018 8:21:14 AM

If you will check same QVD has reloaded 4 Hrs of Interval. Now I need the calculation, whenever it will reload next time What is the QVD size difference from the last reload time.

How I can make an expression from the same.

Can you help me on this.

Thanks.

11 Replies
sunny_talwar

May be this

FirstSortedValue([QVD Size (KB)], -[QVD Time]) - FirstSortedValue([QVD Size (KB)], -[QVD Time], 2)

Gysbert_Wassenaar

If you want to do this in a straight table or pivot table you can use the above function: sum([QVD Size (KB)]-above(sum([QVD Size (KB)]).

If you want to do it in the script you can use the Previous function. You may need to use a resident load to order the data by QVD Time first. If you need help with that it would be useful if you could post the part of your script that create the table with the data you posted.


talk is cheap, supply exceeds demand
sona_sa
Creator II
Creator II
Author

Hi All,

I have the data like :

   

QVD NameQVD Size (KB)QVD Time
ata.qvd1,908.998/1/2018 12:10:30 AM
ata.qvd1,911.118/1/2018 4:25:48 AM
ata.qvd1,914.808/1/2018 8:21:14 AM

If you will check same QVD has reloaded 4 Hrs of Interval. Now I need the calculation, whenever it will reload next time What is the QVD size difference from the last reload time.

How I can make an expression from the same.

Can you help me on this.

Thanks.

sona_sa
Creator II
Creator II
Author

Hi Gysbert,

Thanks for reply. Please find the attached xls for the same.

Please if you have time look into this.

Thanks.

Gysbert_Wassenaar

See attached example


talk is cheap, supply exceeds demand
sona_sa
Creator II
Creator II
Author

Thanks Gysbert.

But we are missing -ve sign.

      

ata.qvd1498.28222713/06/2018 04:42:10
ata.qvd1500.6904313/06/2018 08:32:102.4082031253:50:00-2.4082

I tried to fix it, Not success. Second also can we make a new field means what percentage of QVD size has been done from last reload time to current time.

sona_sa
Creator II
Creator II
Author

Hi Gysbert,

Have you checked my previous post. Is it -ve.

Thanks

sunny_talwar

For getting a negative value... may be try this

If(Previous([QVD Name]) = [QVD Name], Previous([QVD Size (KB)]) - [QVD Size (KB)]) as [QVD Size Change],

instead of this

If(Previous([QVD Name]) = [QVD Name], [QVD Size (KB)] - Previous([QVD Size (KB)])) as [QVD Size Change],

sona_sa
Creator II
Creator II
Author

Hi Sunny,

what percentage of QVD size has been done from last reload time to current time. In the straight table.


Thanks.