Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Ive got a couple of charts that uses the same selections in their set analysis and I thought Id use a variable instead so I can change them all from one place.
ex.
count({<customer={'1001','1002','1003'}, type -= {'10','20'} >} orders)
What Id like is to replace the whole line and in some cases add more selection so it might look something like this;
Count({<$(vCustomerTypeSelection), artnr={'2423','4222'} >} orders)
Is it possible, or do I have to settle with two variables contaning just the "numbers" (in the above case)?
Thanks in advance!
/Tomas
Hi Tomas, your date field is called transdate, set analysis is asigned to a field.
Also the number field is transnr (all lowercase), try with:
=count({1<transdate={'$(vCurrDay)'}>}transnr) & chr(13) &
count({1<transdate={'$(=date(now()))'}>}transnr)
Edit: As Sunny posted above, if you only want the date, is better to use Today() instead of Now().
sorry, I was inconsistent with names and sloppy when I made the exemple...in the exemple it works yes.
But...
Thanks to you I got this to work;
count({1<%Date={'$(=date(now()))'}>}Transnr)
but this doesnt;
Count({1<%Date = {"$(=Date(Today()))"}>} Transnr)
If I use
Let vCurrDay = date(now());
and then
count({1<%Date={'$(vCurrDay)'}>} Transnr)
it all works now but not with "let vCurrDay = today()" or "date(today())"
Hi Tomas, Now() and Today() can have a parameter wich tells the date to return based on:
0 - Script execution
1 - Function call
2 - Document opened
Default for Today() is '2', default for Now() is '1', the thing with option '1' is that system clock changes so often that it can cause an impact on performance, but this is when expression are related between them, usually it works fine.
You can also test in a text box if there is a difference, create a text box with =Date(Now()) and another with =Date(Today()).
I get the same result with both so I don't know why Today() isn't working for you, maybe a typo? Anyway, if Now() gives a good performance keep them.
Its a small app so performance isnt a issue. I'll go with now() for now ![]()
Thanks!