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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
rkpatelqlikview
Creator III
Creator III

If Condition

Hi,

Am showing the trend analysis weekly wise with symbols.

   =if( sum({$<WEEK={$(=Max(WEEK))}>}Sales) < sum({$<WEEK={$(=Max(WEEK)-1)}>}Sales) , 0,1)

When am using this expression its comparing last week sales even the last week is not in present that week is treated as '0'.

For Example:

 

Week  Sales                              

32        100

33         200

34         150

37         300


When am using that expression its taking 36th week as '0'. but i need to compare with last week if its '0' and compare with last of last week even if its '0' it should compare with another previous week. How to write the condition?

Thanks in advance


19 Replies
rkpatelqlikview
Creator III
Creator III
Author

Yes Anil. There is no 44th Week data/ Transaction. When  writing below expression its taking the 44th week is '0'  value and calculating its giving the wrong symbol.

This wrote in layout of that symbol text object.

=if(ceil( sum({$<WEEK={$(=Max(WEEK))}>}Sales)

>

ceil( sum({$<WEEK={$(=Max(WEEK)-1)}>}Sales).

Instead  of this ceil( sum({$<WEEK={$(=Max(WEEK)-1)}>}Sales)

can we go for directly transaction week and compare with that value?

Anil_Babu_Samineni

May be this?

=if((ceil(sum({$<WEEK={$(=Max(WEEK))}>}Sales) or Not IsNull(ceil(sum({$<WEEK={$(=Max(WEEK))}>}Sales) or Len(Trim(ceil(sum({$<WEEK={$(=Max(WEEK))}>}Sales)))>ceil(sum({$<WEEK={$(=Max(WEEK)-1)}>}Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
rkpatelqlikview
Creator III
Creator III
Author

I will Check it Anil Thanks for you quick response

rkpatelqlikview
Creator III
Creator III
Author

No Anil. Its not working.

I need some help

The Below is the expression am using in my image text object layout

=if(ceil( sum({$<WEEK={$(=Max(WEEK))}>} [Safety Voilance])/sum({$<WEEK={$(=Max(WEEK))}>}[Kms Travelled])*1000) 

>

ceil( sum({$<WEEK={$(=Max(WEEK)-1)}>}[Safety Voilance])/sum({$<WEEK={$(=Max(WEEK)-1)}>}[Kms Travelled])*1000) 1,0)

But  its comparing with last week but i need if there is no week it should  skipped that week and compare with the week which is in the x axis.

Weeks are 42 , 43,44,45.

In this current week is 45

so there is no 43 and 44 weeks in my trend then it should compare with 42.

Anil_Babu_Samineni

Will you able to provide sample?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
rkpatelqlikview
Creator III
Creator III
Author

Yes Sure. I will do it now

rkpatelqlikview
Creator III
Creator III
Author

Hi,

There are 4 analysis scr, hr, AR, MR. When you are clicking on anyone it should be show that analysis along with respective symbols. and same for all.

((The trend will show the last 12 weeks of data , the score will be calculated as total number of violations in week / total km driven * 1000 , the score will show green , yellow , red according to the scr value (<20 green , Yellow (20 - 50) , > 50 will show RED)

Capture54.PNG

Thanks in advance

Anil_Babu_Samineni

That's lot make sense. But, Difficult to answer without having something?

If(Measure < 20, Image1, If(Measure >20 and Measure <50, Image2, Image3))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
rkpatelqlikview
Creator III
Creator III
Author

Sure Anil. I will provide in details.

Thanks in advance.

KUMAR.

kumardeveloper19@gmail.com

Anil_Babu_Samineni

Question answered.. So, No need to reply here. Create one more thread with excellent inputs..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful