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

Format number to month name in chart

I would like to create a slider chart to select a month name (jan->dez) with a static step of 1. So it should not be possible to move the arrow between 2 month. The selected month should be written in a variable. Therefore I have

  • created a slider object,
  • defined a variable,
  • set the Min Value to "1",
  • set the max value to "12",
  • set the Static step to "1"

The slider shows me now the values from 1 to 12 and it works as I want so for, but the values will be presented as numbers. How can I format the numbers (1 to 12) as the month names? Is it possible to format the numbers as the month name in the chart tab "number"?

I tried to use something like "MMM" or "##.MMM.####" but the number will be always interpreted as day instead of month. And "#" could not be used as a placeholder.

Thanks for any help in advance.

1 Solution

Accepted Solutions
pradosh_thakur
Master II
Master II

hi daniel

kushal is right. This is the easiest way to do it. i will suggest these steps.

1:

create inline table in your model

LOAD *,Dual(MonthName,Month) as DualMonth Inline [

Month,MonthName

1,Jan

2,Feb

3,Mar

4,Apr

5,May

6,Jun

7,Jul

8,Aug

9,Sep

10,Oct

11,Nov

12,Dec

];

2:
use DualMonth as your filedname in the slider

3:

open variable overview and create a new variable v1 and in the definition =GetFieldSelections(DualMonth)

the value you selected in the slider will be written to the variable v1.

regards

Pradosh

Learning never stops.

View solution in original post

9 Replies
vinieme12
Champion III
Champion III

=month(makedate(year(today()), YOURVARIABLE,1))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Bala_s
Contributor III
Contributor III

Share ua sample data.

Regards,

Bala

daniel1990xyz
Contributor III
Contributor III
Author

I think this will not solve my problem. At the moment my slider looks like this:

slider.JPG

I would like to format the number to month names. So the slider should show "Jan" instead of 1 and so one.

Kushal_Chawda

create inline table in your model

LOAD *,Dual(MonthName,Month) as DualMonth Inline [

Month,MonthName

1,Jan

2,Feb

3,Mar

4,Apr

5,May

6,Jun

7,Jul

8,Aug

9,Sep

10,Oct

11,Nov

12,Dec

];

Use DualMonth field in slider instead variable

daniel1990xyz
Contributor III
Contributor III
Author

Thanks for your reply.

Are there any possibilities to keep the variable? So that the selected value in the slider will be written in a variable?

vinieme12
Champion III
Champion III

Nope, can't do with a variable

You can retrieve the selected value from the Month field

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
pradosh_thakur
Master II
Master II

hi daniel

kushal is right. This is the easiest way to do it. i will suggest these steps.

1:

create inline table in your model

LOAD *,Dual(MonthName,Month) as DualMonth Inline [

Month,MonthName

1,Jan

2,Feb

3,Mar

4,Apr

5,May

6,Jun

7,Jul

8,Aug

9,Sep

10,Oct

11,Nov

12,Dec

];

2:
use DualMonth as your filedname in the slider

3:

open variable overview and create a new variable v1 and in the definition =GetFieldSelections(DualMonth)

the value you selected in the slider will be written to the variable v1.

regards

Pradosh

Learning never stops.
Kushal_Chawda

You can create the variable on front end and put the below expression in variable

=num(only(DualMonth))

daniel1990xyz
Contributor III
Contributor III
Author

Hi Pradosh,

Thank you for your explanation and the sample file. With this information I was able to solve my issue.

regards

Daniel