Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
priya945
Creator
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

Thanks In advance.

Priya

7 Replies
simenkg
Specialist
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.

priya945
Creator
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

vipin_mishra479
Creator II
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 !!

priya945
Creator
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
vipin_mishra479
Creator II
Creator II

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

priya945
Creator
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

sujan24s
Contributor III
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'')))