Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
newqlikie
Creator
Creator

Problem by chossing different periods

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 EUR02.05.2011
32.345 EUR03.05.2011
145.453 EUR04.05.2011
93.929 EUR05.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

21 Replies
Not applicable

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.

newqlikie
Creator
Creator
Author

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 .