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: 
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.