Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to calculate the sales of today.
For that, I have :
- a variable vToday which contains the today's date,
- DateId which is my time dimension
I have tried the following formula with no success :
Sum( {$<DateId={$(vToday)}>} VAT_FREE_TOTAL_AMOUNT_NET)
Do you have any idea why my formula does not work?
Thank you in advance,
MT
You might need to include single plings, as the date is a string
Sum( {$<DateId={'$(=Date(vToday,'DD/MM/YYYY'))'}>} VAT_FREE_TOTAL_AMOUNT_NET)
One thing I would ask you to check is if vToday has the same date format as DateId. Can you share some information on how DateId looks and what does vToday displays in a text box?
Best,
Sunny
Check the format of your variable, it must match the DateId field format.
Use Date() function if you need to format your date format of your variable, or num() if DateId is a number:
Sum( {$<DateId={$(=Date(vToday,'MM/DD/YYYY'))}>} VAT_FREE_TOTAL_AMOUNT_NET)
Sum( {$<DateId={$(=num(vToday))}>} VAT_FREE_TOTAL_AMOUNT_NET)
Hello,
Thanks for your answers !
DateId is a date field --> 20/07/2015
I tried your formula with no success :
- Sum( {$<DateId={$(=Date(vToday,'MM/DD/YYYY'))}>} VAT_FREE_TOTAL_AMOUNT_NET)
- Sum( {$<DateId={$(=Date(vToday,'DD/MM/YYYY'))}>} VAT_FREE_TOTAL_AMOUNT_NET)
- Sum( {$<DateId={$(=Date(vToday))}>} VAT_FREE_TOTAL_AMOUNT_NET)
I also tried with no success :
- Sum( {$<DateId={Date($(vToday))}>} VAT_FREE_TOTAL_AMOUNT_NET)
Any idea?
Thanks,
MT
You might need to include single plings, as the date is a string
Sum( {$<DateId={'$(=Date(vToday,'DD/MM/YYYY'))'}>} VAT_FREE_TOTAL_AMOUNT_NET)
Formatting vToday with Date() will only work if vToday has a numeric representation.
What's the definition and current value of your variable? Have you checked that you have a match of that value with your possible DateId values?
Sorry, this may be a dumb question, but your date field is DateId or is it something else?
Hello,
Thank you everyone ! It is working fine with Jens Frederik Kristiansen's formula.
==> Sum( {$<DateId={'$(=Date(vToday,'DD/MM/YYYY'))'}>} VAT_FREE_TOTAL_AMOUNT_NET)