Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help in Expression


Hi,

I have a line chart with one dimension and multiple expressions.

Dimension is Months

For some of the expressions, i have to calculate expression values as PREVIOUS MONTHS' VALUE - CURRENT MONTHS' VALUE

Is it possible to implement the same?

5 Replies
ali_hijazi
Partner - Master II
Partner - Master II

if 4 (April) is your current month (selected) then previous month would be as follows:

create a variable and name it vPreviousMonths

in the definition put

=max(Month) -1

then in your expression if it is sum(sales)

it would be sum(sales) - sum({<Month={$(vPreviousMonth)}>}Sales)

Hope this helps

I can walk on water when it freezes
ashfaq_haseeb
Champion III
Champion III

ariel_klien
Specialist
Specialist

Hi,

You can try the command 'above'

something like above(sum(value))-sum(value) when the dimension is month.

BR

Ariel

Not applicable
Author

I have to write an expression such as

when YearField=2013, (100-(Prev Value-Curr Value)/Prev Value)*100 as Expr1

and for all other years it should be previous value of Expr1 -((Prev Value- Curr Value) /Prev Value) * 100 as Expr1

mdmukramali
Specialist III
Specialist III

Dear,

can you attach the sample file so that we can help you in a better way.

Thanks,

Mukram