Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
craig157
Contributor

Need help Calling Decimal Format Variables

Hi All,

I want to be able to change the result format of several charts on a specific sheet I am working on.

I've set up the below three variables.

vFormat_NoDecimals = '+##,##0%; -##,##0%'

vFormat_1Decimals = '+##,##0.0%; -##,##0.0%'

vFormat_2Decimals = '+##,##0.00%; -##,##0.00%'

What would be the easiest way to select which format appears on my charts and etc?

I was thinking of setting up another three variables that would change the active status from 0 to 1 but just want to see what everyone thinks before I try setting it up.

Thanks,

Craig

1 Solution

Accepted Solutions

Re: Need help Calling Decimal Format Variables

See, Normally how this happens

SET vFormat_NoDecimals = '+##,##0%; -##,##0%'

SET vFormat_1Decimals = '+##,##0.0%; -##,##0.0%'

SET vFormat_2Decimals = '+##,##0.00%; -##,##0.00%'

And then Num(Sum(Measure), vFormat_NoDecimals)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

9 Replies

Re: Need help Calling Decimal Format Variables

What are you going to get using this variable?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
craig157
Contributor

Re: Need help Calling Decimal Format Variables

So in my chart I display a value like "Colour Ratio 45%" which would use vFormat_NoDecimals.

Ideally it would use these variables like this:

vFormat_NoDecimals

vFormat_1Decimals

vFormat_2Decimals

Hope this makes sense.

Re: Need help Calling Decimal Format Variables

Normally, Expression should be

Num(Expression, 'Your Format')

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
craig157
Contributor

Re: Need help Calling Decimal Format Variables

Anil - that is already happening... I am trying to make the 'Your Format' into a variable I can change to the three variables I've already advised so we can have different formats depending on the Users Selection.

Re: Need help Calling Decimal Format Variables

See, Normally how this happens

SET vFormat_NoDecimals = '+##,##0%; -##,##0%'

SET vFormat_1Decimals = '+##,##0.0%; -##,##0.0%'

SET vFormat_2Decimals = '+##,##0.00%; -##,##0.00%'

And then Num(Sum(Measure), vFormat_NoDecimals)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

Highlighted
craig157
Contributor

Re: Need help Calling Decimal Format Variables

Thanks Anil,

So now I have a new issue!

In my equation I've got a new variable vFormat_FormatSelecter which I will assign vFormat_NoDecimals too when a button is selected. And another button for vFormat_2Decimals and etc.

Unfortunately when entered this way it is just bringing up the text name of the variable and not formatting the answer.

Any ideas?

Thanks

Re: Need help Calling Decimal Format Variables

Not sure i followed, Can you help us to show the expected result. That would be offer more clear rather functional. And what i understand is Auto Hide show objects.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
craig157
Contributor

Re: Need help Calling Decimal Format Variables

See the images I sent previously would be the end result....

So I would define the original equation to be:

vFormat_FormatSelecter



On another section of my layout I have three buttons that set the variable vFormat_FormatSelecter

Button 1 - vFormat_NoDecimals            this has been set as '+##,##0%; -##,##0%'

Button 2 - vFormat_1Decimals           this has been set as '+##,##0.0%; -##,##0.0%'

Button 3 - vFormat_2Decimals          this has been set as '+##,##0.00%; -##,##0.00%'

Re: Need help Calling Decimal Format Variables

True, In each image you need to use all buttons, But unfortunately button doesn't have future called Number format in Qlikview.

1) Create 3 buttons and assign variable with empty value and then call them as in Button with Variable from external section to each chart

2) Finally, You could call each variable to each chart of format where you are indeed.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)