Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Shady
Contributor
Contributor

Comparing values and plotting them

I have been given a task to get a value from multiple QVD files and compare it to one global variable.

I have written one section for each QVD file and getting the date and comparing with the global variable.

Sample code for each section is:

sub Account(dummy)
if FileSize('$(vQVDSourceFileName)$(vSource).qvd') > 0 then
TempTable:
LOAD *
FROM [$(vQVDSourceFileName)$(vSource).qvd](qvd);

AutoNumberQVDDate:
LOAD DISTINCT QVDDATE
Resident TempTable;
AutoNumber1:
LOAD max(QVDDATE) AS Key
Resident AutoNumberQVDDATE;

let maxDate = PEEK('Key',0,'AutoNumber1');

let Days = DATE(vWarehouseDate) - DATE(maxDate);

Switch Days

Case 0

let color = 'Blue';

Case 1

let color = 'Yellow';

Default

let color = 'Red';

end Switch
end if
end sub

 

I have written a seperate section to call each of the above sections - one for each file. When I click on Load Data, it compiles successfully. How do I plot the Colors for each file on a graph?

 

Thank you.

Labels (1)
1 Reply
Shady
Contributor
Contributor
Author

To answer my own question, I loaded the color and filenames onto a table, kept appending it till I ran out of files, pushed the final table onto a qvd file and used that to plot my graph.