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: 
sridhar423
Contributor III
Contributor III

How can we get a previous field values from a field?

Hi All,

I have a table name Quarter with field values  Q 1, Q 2, Q 3, Q 4. If i select the Q 4 i should get Q 3 ,if i select Q 3 i should get Q 2,if i select Q 1 i should get Q 4.

Please anyone can help me out from this.

Thanks In advance,

Sridhar.

3 Replies
sunny_talwar

You can use Above/Below function to achieve what you are trying to do.

HTH

Best,

S

maxgro
MVP
MVP

try the attachment

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I usually add a month sequence field to deal with the same problem with months. A QuarterSequence would be like this:

LOAD ...

     Ceil(Month(Date) / 3) As Quarter,

     (Year(Date) * 4) + Ceil(Month(Date) / 3) As QuarterSequence,

     ...

If you select a Quarter, then Max(QuarterSequence) - 1 will reference the previous quarter. You could use this in a set expression like:

     Sum({<QuarterSequence = {"$(=Max(QuarterSequence) - 1)"}>} ....)

If you are trying to do this in a table/chart with Quarter as a dimension, then Above() or Above(Total ) would be a better option as the set expression will not work in this context.

HTH

Jonathan

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