Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

dynamic visibility of image based on current month vs last month

Hi All,

I want the thumps up image to be shown if the total for selected month (lets say match) is greater thn total of its previous month (feb) and vice versa.

Thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

In my case, it is working. I don't know how come it is not working in yours. I have attached mine. see it

and in that if u select 2023, then it will show previous text box as in that 2022 data>2023 and rest current.

View solution in original post

14 Replies
Not applicable
Author

Hi Yousuf,

The month field is in text format, it would be better if he were extracted from any one date, so you could use the AddMonths function (date, -1) to find the previous month. Find your table in a date field where you can extract the month and year using the functions month (date field) and year (date field) respectively.

best regards.

Not applicable
Author

i am still not clear about the solution. I have attached my raw data. You can edit the field as you want since i am preparing a demo dashboard.

I appreciate if someone guides me on this.

Not applicable
Author

any help on this

Not applicable
Author

Hi,

As per my understanding of the requirement, you can do the lkayering of text boxes giving the images.

If selected month sales is greater than selected previous month's sales then show green thumbs up and hide other one and vice versa.

For this you can put the condition in the text box layout "=if(sum({$<Year={$(hj)}>}Revenue)>sum({$<Year={$(kj)}>}Revenue)"   where hj is a variable =Getfieldselections(Year) and kj is a variable =Getfieldselections(Year)-1

And for your data, you can put month in place of year.

Thanks.

Not applicable
Author

Hi,

I tried your expression along with another expression that sumbody else suggested and both not working. Ideally they should work. Have kept 2 thumb down arrows with 2 different expressions.... i believe i m missing sumthing v minor. can you please check and let me know.

Thanks a ton in advance

Not applicable
Author

I have seen. Please first try one thing, in the first thumb text box-  go to layout condition, there one ')' is missing.

Try to put this. and even if doesn't work. Then i'll go further.

Not applicable
Author

Even i noticed there is a missing ')" at the end. but its not accepting it ...dont know why...may be u can give it a final try

Not applicable
Author

=sum({$<Month={$(hj)}>}[Total Gene])>sum({$<Month={$(kj)}>}[Total Gene])

write this for the condition where current month sales is greater

and sum({$<Month={$(kj)}>}[Total Gene])>sum({$<Month={$(hj)}>}[Total Gene])

write this for the condition where previous month sales is greater

This will work.

Not applicable
Author

not working..i tried this earlier...............tired of this problem now....