Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello together,
at the moment, I am struggling with following problem:
I have a database with daily turnovers (Monday to Friday). The turnover begins at 05.01.2009 and ends yesterday.
For example:
Umsatz (Turnover) | JARECDAT |
---|---|
123.456 EUR | 02.05.2011 |
32.345 EUR | 03.05.2011 |
145.453 EUR | 04.05.2011 |
93.929 EUR | 05.05.2011 |
100.011 EUR | 06.05.2011 |
Now I have separated the dates to "Day", "Month" and "Jear".
Now I would like to compare the turnover from this month with the same timeperiod one year ago.
For example: 01.09.2011 till 20.09.2011 is to compare with 01.09.2010 till 20.09.2010
If I use following function, I will always get the turnover one year ago till 30.09.2010 and not till 20.09.2010
Sum({$<Jahr={$(=Only(Jahr)-1)},MONAT={"<=$(=month(JARECDAT))"}>} Umsatz)
It also could be the actual quarter starting from 01.07.2011 till 20.09.2011 which has to be compared with 01.07.2010 till 20.09.2010.
The function above will always give the date starting 01.07.2010 till 30.09.2010.
What do I do wrong?
I appreciate your help.
Regards
NewQlikie
Hi,
this is may last Attempt..
Sum({$<Jahr={$(=Only(Jahr)-1)}, Monat-={$(#=(month(today())))}>+
<Jahr={$(=Only(Jahr)-1)},Monat={$(#=(month(today())))},Tag={"<=$(#=max({$<Monat={$(#=month(today()))}>}Tag))"},Monat=P(Monat)>}Umsatz)
Ste.
Hi Stefano,
thank you a million times.
I could hug you, but you wouldn't like it , so I'm going to send you my colleague
.