Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
vipingarg23
Creator
Creator

Issue

Hi Team,

Please find the dummy data as an attachment.

Requirement:


I have one dimension YearQuarter and two expression A1 and B1.

I want to calculate B1 expression in such a way that whatever data i have in A1 for YearQuarter=2016Q1 that should come in B1 for YearQuarter=2016Q2 and whatever data i have in A1 for YearQuarter=2016Q2 that should come in B1 for YearQuarter=2016Q3 and so on.


Can anybody give me the solution?


Thanks for your help!!!!!!!!!

1 Solution

Accepted Solutions
sunny_talwar

Try this

=Before(Sum({<YearQuarter>}Data)) * Avg(1)


Capture.PNG

View solution in original post

16 Replies
sunny_talwar

Try this

=Before(Sum({<YearQuarter>}Data)) * Avg(1)


Capture.PNG

vishsaggi
Champion III
Champion III

may be try this for your B1

= = Before(Sum(Data),1,4)

sunny_talwar

What are you using 4 for?

neelamsaroha157
Specialist II
Specialist II

May be you can create one more transaction table by residenting the table where you have your 'Data' field and just replace the date fields with adding one quarter and renaming field 'data' to 'Data2' and use this field for your second expression.

I hope I was able to explain what I mean to say.

vishsaggi
Champion III
Champion III

Sunny why we have to disregard Dim YearQuarter?

vishsaggi
Champion III
Champion III

Not required sorry.

Just before(Sum(Data)) will suffice.

neelamsaroha157
Specialist II
Specialist II

Here is the sample. I have hard coded but you can achieve same with the expressions.

sunny_talwar

So, you are essentially referring to using The As-Of Table

sunny_talwar

Just so you still get a value when one or multiple YearQuarter are selected