Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Curr qtr vs prev qtr

HI All,

Need to create current vs previous qurter..

For Example:

If I select 2016 Q1 then Output should be --- 2016 Q1   & 2015 Q4.

If I select 2015 Q3 then Output should be --- 2015 Q3   & 2015 Q2.

Kindly help me on this..

Regards,

Helen

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See attached example.


talk is cheap, supply exceeds demand

View solution in original post

14 Replies
Gysbert_Wassenaar

Create a numeric quarter field, for example a date:

Dual( Year(MyDate) & 'Q' & Ceil(Month(MyDate)/3), QuarterStart(MyDate)) as MyQuarter

Then create two expressions:

Current Quarter: Sum(Amount)

Previous Quarter: Sum({<MyQuarter#={'$(=QuarterStart(Max(MyQuarter),-1))'}>}Amount)

And if it doesn't work please post a small qlikview document with some example data.


talk is cheap, supply exceeds demand
jonathandienst
Partner - Champion III
Partner - Champion III

In your calendar, add Quarter sequence number - something like"

     ...

     Year(Caldate) * 4 + Floor(Month(Caldate) / 4) As QSeq,

     ...

Now you can use a simple set expression:

     Current quarter:

     Sum({<QSeq = {"$(=Max(QSeq))"}>} Amount)

     Previous quarter

     Sum({<QSeq = {"$(=Max(QSeq)-1)"}>} Amount)


(replace CalDate with the date field in your calendar and adapt the above expression to your requirements)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

attached the excel & app as above

Regards,

Helen

Gysbert_Wassenaar

See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks..

With out any selection also i need to See Current quarter & Previous Quarter

Regards,

Helen

Gysbert_Wassenaar

Then make sure your data contains data from 2016. The document you posted doesn't.


talk is cheap, supply exceeds demand
Not applicable
Author

Make it default current quarter & previous quarter..

Regards,

Helen

Not applicable
Author

Based on the given data  .Make it default current quarter & previous quarter..

Regards,

Helen

Gysbert_Wassenaar

Can't. Current quarter is the first quarter of 2016. Your document does not contain data from 2016.


talk is cheap, supply exceeds demand