Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
CezarioAbrantes
Contributor III
Contributor III

Show the value of a dimension in a button

I need to show the value of a dimension in 2 buttos (yellow-colored in the "Dashboard" tab in the file attached). 

The values needed to be shown are the last month and the current month in format "mmm/yyyy".

The last and current month are on the basis in thie field "Análise Mensal", as "Mês Anterior" - last month - and "Mês Atual" - current month. In this case, the values in the buttons should be "Oct/2020" and "Nov/2020".

Thanks!

2 Solutions

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

try this

=date(date#(Only({< [Análise Mensal] = {'Mês Atual'} >} [Ano-Mês]),'YYYY-MM'),'MMM/YYYY')

View solution in original post

lorenzoconforti
Specialist II
Specialist II

It's used to evaluate a string as a date; basically, it converts an input to a date data type

https://help.qlik.com/en-US/sense/February2020/Subsystems/Hub/Content/Sense_Hub/Scripting/Interpreta...

View solution in original post

8 Replies
CezarioAbrantes
Contributor III
Contributor III
Author

Another question about the same tab "Dashboard". There is a button called "UNIDADE DE NEGÓCIO", and I need that appear in this field, instead "UNIDADE DE NEGÓCIO", the value that is selected in the filter "Unidade de Negócio". For example:

If I select "OWN PORTFOLIO - ALTHAIA" in the filter, the button needs to show "OWN PORTFOLIO-ALTHAIA".

And when nothing is selected in the filter, it needs to show "TOTAL GERAL".

Is it possible?

lorenzoconforti
Specialist II
Specialist II

Which extension are you using for the buttons? 

CezarioAbrantes
Contributor III
Contributor III
Author

Sorry, what is extension in this case? I forgot to upload the new file. Follow attached now.

I've done some changes since the last message, so please take a look at the tab "Dashboard". Where you see "UNIDADE DE NEGÓCIO", I need to show exactly what I explained in the messages above, and where you see "2020-01" and "2020-02", I need to show "Jan/2020" and "Feb/2020".

Thank you.

lorenzoconforti
Specialist II
Specialist II

This is what I see. What object are you using to create the buttons? Margem.png

CezarioAbrantes
Contributor III
Contributor III
Author

I don't know what happened. Anyway, the problem in "UNIDADE DE NEGÓCIO" I could solve by my own, just using the expression:

=if(isnull(only([Unidade de Negócio])),'TOTAL GERAL',only([Unidade de Negócio]))

But the other problem continues. In the button, I have the expression:

=Only({< [Análise Mensal] = {'Mês Atual'} >} [Ano-Mês])

This expression returns 2020-02, but I need to change this to "Feb/2020". In order to make it easier, if you think it is, there are 2 columns in the basis where we have Month and Year separated (2 and 2020) that we can use as well.

lorenzoconforti
Specialist II
Specialist II

try this

=date(date#(Only({< [Análise Mensal] = {'Mês Atual'} >} [Ano-Mês]),'YYYY-MM'),'MMM/YYYY')

CezarioAbrantes
Contributor III
Contributor III
Author

Perfect!

What's the meaning of using # after "date"?

Thanks!

lorenzoconforti
Specialist II
Specialist II

It's used to evaluate a string as a date; basically, it converts an input to a date data type

https://help.qlik.com/en-US/sense/February2020/Subsystems/Hub/Content/Sense_Hub/Scripting/Interpreta...