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

Time period comparison

Hi All,

I want to create a column which compares current month against the previous month. The format of months is 01 JAN, 02 FEB, 03 MAR. Is it possible to set it up so that the calculation is dynamic so that when current month changes it changes automatically?

 

Many Thanks

Labels (5)
1 Solution

Accepted Solutions
Rams-
Creator
Creator

Hi,

you can use

Rams_0-1680861759558.png

In table the output will be with expression:

Rams_1-1680861849654.png

 

Output with data expression:

Rams_2-1680862424778.png

Hope this helps,

help user find answers ! don't forget to mark  a solution that work for you and click the like button!

View solution in original post

2 Replies
vikasmahajan

Hi ,

You can achieve the same in set analysis using variables:

The syntax for the set analysis in Qlik Sense using a variables is slightly different.

vCurrentMonth   = Date(max([MonthYear]), 'MMM-YY')

vPreviousMonth = Date(addmonths(max([MonthYear]), -1), 'MMM-YY')

 

Expression

 

sum({$<MonthYear ={'$(=$(vCurrentMonth))'}>}[Expense Amt])

sum({$<MonthYear = {'$(=$(vPreviousMonth))'}>}[Expense Amt])

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Rams-
Creator
Creator

Hi,

you can use

Rams_0-1680861759558.png

In table the output will be with expression:

Rams_1-1680861849654.png

 

Output with data expression:

Rams_2-1680862424778.png

Hope this helps,

help user find answers ! don't forget to mark  a solution that work for you and click the like button!