7 Replies Latest reply: Jul 20, 2015 7:15 AM by Minh-Tri Truong

# What is wrong with my set analysis

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?

MT

• ###### Re: What is wrong with my set analysis

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

• ###### Re: What is wrong with my set analysis

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)

• ###### Re: What is wrong with my set analysis

Hello,

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

• ###### Re: What is wrong with my set analysis

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)

• ###### Re: What is wrong with my set analysis

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?

• ###### Re: What is wrong with my set analysis

Sorry, this may be a dumb question, but your date field is DateId or is it something else?

• ###### Re: What is wrong with my set analysis

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)