Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm using variable to store expression, but it's not working for a specific one :
LET vSommeCA = 'sum({$<DateFacture={">=$(=Min(Date))<=$(=Max(Date))"}>}FACT_LIGNE.CAHT)';
Any idea ?
Thanks
Hi,
Try SET instead of LET.
SET vSommeCA = 'sum({$<DateFacture={">=$(=Min(Date))<=$(=Max(Date))"}>}FACT_LIGNE.CAHT)';
Regards,
Kaushik Solanki
Still not working ...
Probably it is due to date format, try to transform everything in Num(date(...)).
this convert all dates to correspondand values and comparisons are surely correct
Obviously you have to add a field in the script that transform DateFacture to num(DateFacture)
Hopeit helps
Hi,
Kindly upload qvw file.
Regards,
Kaushik Solanki
Another idea to test the expression is to substitute Min(Date) and Max(Date) with values you exect
for example:
SET vSommeCA = 'sum({$<DateFacture={">=19/04/2013<=21/04/2013"}>}FACT_LIGNE.CAHT)';
in this way you camìn understand better where is the problem
When using dates in set analysis, I always make sure they are in date format, e.g.:
sum({$<DateFacture={">=$(=date(Min(Date)))<=$(=date(Max(Date)))"}>}FACT_LIGNE.CAHT)
Have a look to the attached file please
HI ,
I dont know but have tried having "=" at the Begining like below
SET vSommeCA = "=sum({$<DateFacture={">=$(=Min(Date))<=$(=Max(Date))"}>}FACT_LIGNE.CAHT)";
//yusuf
Trouble is, SET/LET will try to expand all $() expressions at assignment time. And I suppose you want to have $(=Min(Date)) in your expression, not whatever the min/max date is at the time of reload (actually, I highly suspect it would be (internal error) 😉 )
Probably easiest way to get around this would be to mask the $() expression somehow in SET, then unmask it using LET. Or go with LET and string concatenation, but that is, in my humble opinion, a pain.