Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate period of time

I have been looking the Community to find a way wchich will solve my problem, but i didn't find;(

I found an expression and tried to adopt to my aplication



Sum ({$<[Sales area]={'<b.o.>','VSG','ESG','FRG','SzcESG'},YearMonth = {'>=((=Left(Min(YearMonth), 4)-1)&Right(Min(YearMonth),2))<=((=Left(Max(YearMonth),4)-1)&Right(Max(YearMonth),2)'}>} Value)/1000


I need to calcute value for the same time period but "Year-1". It wouldn't be problem if i Had only one year, but user can choice from sleection for example

200911

200912

201001

201002



1 Solution

Accepted Solutions
Not applicable
Author

I found the solution



(((Sum ({$<[Sales area]={'<b.o.>','VSG','ESG','FRG','SzcESG'},YearMonth={">=$(=((Left(Min(YearMonth), 4)-1)&(Right(Min(YearMonth),2))))"}*{"<=$(=((Left(Max(YearMonth), 4)-1)&(Right(Max(YearMonth),2))))"}>} Value))))/1000




View solution in original post

2 Replies
Not applicable
Author

format for YearMonth is:

YYYYMM

Not applicable
Author

I found the solution



(((Sum ({$<[Sales area]={'<b.o.>','VSG','ESG','FRG','SzcESG'},YearMonth={">=$(=((Left(Min(YearMonth), 4)-1)&(Right(Min(YearMonth),2))))"}*{"<=$(=((Left(Max(YearMonth), 4)-1)&(Right(Max(YearMonth),2))))"}>} Value))))/1000