Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Simple set analysis question

Hi Community,

In the expression below I want to replace '1-6-2016' with a variable (sum( {<Datum = (Datum*{"<$(vDate)"}) >} #CNTF) is not working ). How?

I also want to aggregate this expression below. How?

sum( {<Datum = (Datum*{"<1-6-2015"}) >} #CNTF)

Regards,

Arjan IJlenhave

8 Replies
sunny_talwar

Not sure I understand your syntax. What is this part doing? (Datum*{"<$(vDate)"})

Not applicable
Author

Your syntax is somehow misleading. can you please explain what you want to do with your expression.

You may need like below:

sum( {<Datum = {"<1-6-2015"}>} #CNTF)

Anonymous
Not applicable
Author

The syntax gives in a selection all measures of dates smaller then a variable (in the example it is 1-6-2015)

Looking for smaller dates I have to aggregate the expression.

For now the variable is working, only the agrr() is not.

I want something like this:

sum(  aggr(   {<Datum = {"<$(vDate)"}>}  #CNTF), ObjectKey)

swuehl
MVP
MVP

You can apply set expressions only to aggregation functions, not to the AGGR() function.

Try:

sum( {<Datum = {"<$(vDate)"}>} aggr(   Sum( {<Datum = {"<$(vDate)"}>}  #CNTF), ObjectKey))

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Ah, so do we again have a documentation error that has been hiding in QV Desktop help since a while?

aggr help.jpg

swuehl
MVP
MVP

Yes, at least I have never made it work as defined in the HELP.

Anonymous
Not applicable
Author

I hope the example below will help to solve this problem:

Expression B must result for Objectkey (123) in values #CNTF for 7-1-2015, 18-2-2015 and 15-3-2015 because these values are before EndDate 1-4-2015, Expression B must result for Objectkey (456) in values #CNTF for 7-1-2015, 18-2-2015, 15-3-2015, 15-4-2015 and 19-5-2015 because these values are before EndDate 1-6-2015.

The Final object must be without the fields (ObjectKey, EndDate en Date)

RelatieKeyObjectKeyEndDateDateCNTFB
NL#31175221231-04-157-1-2015-9,17-9,17
NL#31175221231-04-1518-2-2015-10,33-10,33
NL#31175221231-04-1515-3-2015-10,33-10,33
NL#31175221231-04-1515-4-2015114,580,00
NL#31175221231-04-1519-5-2015104,170,00
NL#31175221231-04-1517-6-201593,750,00
NL#31175224561-06-157-1-2015-9,74-9,74
NL#31175224561-06-1518-2-2015-9,74-9,74
NL#31175224561-06-1515-3-2015-9,74-9,74
NL#31175224561-06-1515-4-2015-9,74-9,74
NL#31175224561-06-1519-5-2015-9,74-9,74
NL#31175224561-06-1517-6-201591,850,00
martijn
Contributor III
Contributor III

What if you just add a line in the script:

If(Date<EndDate, CNTF, 0) as CNTFDate