Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to retrieve the max date from a QVD. Date is in YYYY-MM-DD HH:MM:SS format. Below is my code:
Master:
LOAD
*
FROM [lib://IT Standard Metrics/QVD\Combined_Result.qvd]
(qvd);
Max:
load ([sys_updated_on]) as [Max_sys_updated_on]
resident Master ;
Let vMax = peek('[Max_sys_updated_on]',0,'Max');
However vMax is not populating anything.
Could you please help me on this?
Thanks,
Sarif
HI Sarif,
First check whether the Max table is loading properly with proper values in Max_sys_updated_on. Also you can apply date function while loading the Max table with [sys_updated_on].
Max:
load max([sys_updated_on]) as [Max_sys_updated_on]
resident Master ;
Let vMax = Fieldvalue('Max_sys_updated_on', 0);
this is also not working... my set expression in chart is :
count ({$<[sys_updated_on] = {'$(=$(vMax)'}>}number)
Please try below. You rename your variable into a max, but you're not taking the max, as you're taking the first value of Max_sys_updated_on in the 'Max' table. By sorting the table so that the highest date comes first, you will select the max.
Master:
LOAD
*
FROM [lib://IT Standard Metrics/QVD\Combined_Result.qvd]
(qvd);
noconcatenate
Max:
load ([sys_updated_on]) as [Max_sys_updated_on]
resident Master
order by [sys_updated_on] desc;
Let vMax = peek('[Max_sys_updated_on]',0,'Max');
this is also not working sir...
Hi,
maybe something like this:
//Load data from QVD
Master: LOAD * FROM [lib://IT Standard Metrics/QVD\Combined_Result.qvd] (qvd);
//Get max from sys_updated_on field
Max:
noconcatenate
load MAX([sys_updated_on]) as [MaxValue] resident Master;
//Assign max value to variable
Let vMax = peek('[MaxValue]',0,'Max');
Please let me know if this helps.
Kind regards,
this is also not working...Santiago
Please can you share a sample app or some snapshots, the code provided should work.
Maybe there's a formatting issue when comparing in your expression, it would be easier if you could share a little bit more.
Have you verified you variable value after the scripts run? does it have the correct value?
Kind regards,
Try this
Max:
noconcatenate
load MAX([sys_updated_on]) as [MaxValue] resident Master order by [sys_updated_on] desc;
//Assign max value to variable
Let vMax = peek('[MaxValue]',0,'Max');
But a Sample would be helpful