Announcements
cancel
Showing results for
Did you mean:
Creator

## Compare Lastweek with Currentweek and difference should be shown in arrow

Hi All,

Please help me with expression for below output. Compare Lastweek with Currentweek and difference should be shown in arrow

a. Negative change then Red downarrow

b. Positive change then Green Upfilledarrow

Priya

7 Replies
Specialist

if([Current Week] - [Last Week] >0

,'qmem://<bundled>/BuiltIn/arrow_n_g.png',

'qmem://<bundled>/BuiltIn/arrow_s_r.png')

Then change representation to: "image" and Image formatting to the desired fill effect.

Creator
Author

Thanks Simen for quick reply but my requirement is to compare Lastweek with Currentweek

a. if the Currentweek value is greater than Lastweek then green arrow

b.  if the Currentweek value is less than Lastweek then red arrow

c. No change then <> in yellow

Creator II

First calculate the current week

vCurrentWeek = Max(Week)

vLastWeek = Max(Week)-1

The use Expression

Exp1 :- Current Week Data = Sum({<Week = {vCurrentWeek}>}Amount)

Exp 2 :- Last Week Data = Sum({<Week = {vLastWeek}>}Amount)

if(Sum({<Week = {vCurrentWeek}>}Amount) - Sum({<Week = {vLastWeek}>}Amount) >0

,'qmem://<bundled>/BuiltIn/arrow_n_g.png',

if(Sum({<Week = {vCurrentWeek}>}Amount) - Sum({<Week = {vLastWeek}>}Amount) <0

'qmem://<bundled>/BuiltIn/arrow_s_r.png'),

'qmem://<bundled>/BuiltIn/arrow_k_g.png'),

Hope this will help !!

Creator
Author

Here is my requirement

a. if the Currentweek value is greater than Lastweek then green arrow

b.  if the Currentweek value is less than Lastweek then red arrow

c. No change then <> in yellow

Store nameLast WeekCurrent Week
Store C130110
 Red downarrow
Store F8070Red downarrow
Store I109110                               Green Upfilledarrow
Store H8587Green Upfilledarrow
Store E130140Green Upfilledarrow
Creator II

if expression tab you have a Green red and yellow arrow Please check and implement it.

Creator
Author

I have managed to get the below expression

=if(SUM({\$<Week = {\$(=MAX(Week))}>}Value)>SUM({\$<Week = {\$(=MAX(Week)-1)}>}Value), 'G',
(
if(SUM({\$<Week = {\$(=MAX(Week))}>}Value)<
SUM({\$<Week = {\$(=MAX(Week)-1)}>}Value), 'R', 'N')))

But I need to replace G,R,N with arrow marks. i am new to qlikview please suggest how to replace

Contributor III

Hi,

can you check this

=if(SUM({\$<Week = {\$(=MAX(Week))}>}Value)>SUM({\$<Week = {\$(=MAX(Week)-1)}>}Value), ''qmem://<bundled>/BuiltIn/arrow_n_g.png'',
(
if(SUM({\$<Week = {\$(=MAX(Week))}>}Value)<
SUM({\$<Week = {\$(=MAX(Week)-1)}>}Value), ''qmem://<bundled>/BuiltIn/arrow_n_g.png'', ''qmem://<bundled>/BuiltIn/arrow_s_r.png'')))

Community Browser