Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare 2 rows from 1 column for gauge chart to change color

Hi guys, so i'm having this trouble that is keeping me from advancing in my Project. Keep in mind that i'm not very well trained in the expresions theme because of the lack of content about it (considering i'm starting from scratch, and in my company theres no one with the enough knowledge to teach me).

So here's the thing, I have information in such way that every App I've got has many dates of revision asociated, and in every date, there are 3 values (security, portability and global percentage of performance). With this, I have a gauge, and I need to program the expression so it turns red when the security percentage from the last date is lower than the security percentage from !the second last date and Green when otherwise. So far I only know that I need an if so I can ask wich of both values is lower, being the THEN statement the RGB() function that will set the color in my gauge. What I dont know is how I can reference to both values so I can compare them, and there seems to be no function to help me with this.

Sadly, I have been searching through documents, files and every tutorial I have found (including blogs, qlik community, tutorials of clik and so on) finding no answer to my question.
If you need more information, I will gladly upload it so you can see it.

(Pardon me for my english, I'm from southamerica)

(I'm using QlikView 12)

Regards,

Lino.

9 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Lino,

All you require is set analysis.

It would be easy to assist you if you post some sample data.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Sure, here goes. Basically, there is a table that has the ID of the App as primary key, and the name of it. In the other table, the id_app is as a foreign key, and there are other fields as date, security, portability and global performance.

app table.png

OPT table.png

For example, here the security performance from the last date is less than the performance of the last second, this is exactly what I need to program.for the gauge to turn red.

I checked set analysis too, but since I have no license for the program, I cannot open other files that are not mine, and that is a big restriction for learning.

Aprecciate the help, Kaushik.

Regards

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Here we go. Use below expression in text box.

If(only({<date = {"$(=Max(Date))"}>}Security) <= only({<date = {"$(=Max({<Date = {"<$(Max(Date))"}>}Date))"}>}Security), Red(), Green());


Make a selection on Id_App.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Kaushik, sorry for not responding earlier but I have the information at my job, so there's nothing I can do on weekend.

I'm having a problem with the expression you gave me on the second part of the if, here goes an image.

Really apreciate the help though.

Sin título.png

Regards,

Lino cortés 

sunny_talwar

You cannot have double quotes within doube quotes, try this may be:

{"$(=Max({<Date = {'<$(=Max(Date))'}>}Date))"}

Not applicable
Author

Hi Sunny,

That solves the syntax problem I was having with the expression, but the gauge still doesn't turn red or green.

Regards,

Lino Cortés

sunny_talwar

Do you have a sample you would be able to share?

Not applicable
Author

Sure, here goes what I have so far on QlikView. The gauge's expression seems to be the only thing that's keeping me from advancing in the Project.

Regards

Not applicable
Author

Could it have something to do with the fact that the percentages i'm uploading are in text format?