Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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?

Thank you in advance,

MT

1 Solution

Accepted Solutions
jfkinspari
Partner - Specialist
Partner - Specialist

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)

View solution in original post

7 Replies
sunny_talwar

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

swuehl
MVP
MVP

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)

Anonymous
Not applicable
Author

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

jfkinspari
Partner - Specialist
Partner - Specialist

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)

swuehl
MVP
MVP

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?

sunny_talwar

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

Anonymous
Not applicable
Author

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)