Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to use set analysis almost for the first time. I think I'm getting hung up on syntax.
QlikView says the expression is OK, but it is still gives me the sum of cloudAgentSpaceUsedGB instead of limiting the set to the most recent cloudAgentSnapshotDate. Am I doing something wrong?
sum( {$<cloudAgentSnapshotDate = {"=max(cloudAgentSnapshotDate)"} >} cloudAgentSpaceUsedGB)
Thanks!
-Kevin
Date comparisons can be tricky. Try going with a literal (single quotes) instead of a search (double quotes)
change:
sum( {$< = {"=max(cloudAgentSnapshotDate)"} >} cloudAgentSpaceUsedGB)
to:
=sum( {$<cloudAgentSnapshotDate={'$(=Date(max(cloudAgentSnapshotDate)))'}>} cloudAgentSpaceUsedGB)
Date comparisons can be tricky. Try going with a literal (single quotes) instead of a search (double quotes)
change:
sum( {$< = {"=max(cloudAgentSnapshotDate)"} >} cloudAgentSpaceUsedGB)
to:
=sum( {$<cloudAgentSnapshotDate={'$(=Date(max(cloudAgentSnapshotDate)))'}>} cloudAgentSpaceUsedGB)
few things to consider:
1. format of the date. max(cloudAgentSnapshotDate) will return numeric value of the date which is being compared to formatted time value, cloudAgentSnapshotDate.
2. Date function with the correct formatting should help. something like - Date(max(cloudAgentSnapshotDate), 'MM/DD/YYYY') - modify the format to your application. if the format is not correct, the sum value will not be what you expect as well.
3. i would set a variable and use it in the set analysis expression. so define a variable vMaxDate as the expression in step 2 and for your sum expression the following:
sum( {$<cloudAgentSnapshotDate = {"$(=vMaxDate)"} >} cloudAgentSpaceUsedGB)
hope this helps.
Thanks, Jonathan! It didn't like the Date function, but the single quotes did the trick. I appreciate your help.