
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Selecting decimal places dynamically
Hi,
I am very much new to QlikView...just started with this tool....
I have a requirement...there is a revenue column in my dashboard, in which numbers appear till 15 decimal places. My requirement is to make an input field- in which user can put no. as per his choice(0-15), and depending upon the number inserted(0-15) decimal places should appear.
For eg:- If I say 5 decimal places, revenue in the column should appear till 5 places of decimal only.
Can you guys help me with this requirement.
Cheers
Ali
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe use a variable vFormat that creates a format string from the user input vNumberOfDigits:
='#,##0.' & Repeat('0',vNumberOfDigits)
(adapt format to your needs, e.g. the integer part)
Then, in your chart, use something like
=Num( Sum(Revenue), vFormat, '.',',')


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe use a variable vFormat that creates a format string from the user input vNumberOfDigits:
='#,##0.' & Repeat('0',vNumberOfDigits)
(adapt format to your needs, e.g. the integer part)
Then, in your chart, use something like
=Num( Sum(Revenue), vFormat, '.',',')


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Stefan's approach above should work. If you prefer modifying the actual value to get sums consistent with your display (that is, rounding it off or flooring it), you could also use:
Floor(YourValue,1/(pow(10,vNumOfDigits))
You can also replace Floor() with Round() depending on the behavior you want.
e.g. for three digits selected and a value of 1.23456, this would resolve to:
Floor(1.23456,1/10^3)
=
Floor(1.23456, 0.001)
=
1.234
Round() with the same values would result in 1.235.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I tried implementing, but can't get through it...can you please explain it more?
Also can you please explain the integer format and how to implement it as per the requirement?
Cheers
Ali


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Freeky Ali wrote:
Hi,
I tried implementing, but can't get through it...can you please explain it more?
Also can you please explain the integer format and how to implement it as per the requirement?
Cheers
Ali
How could I explain the integer format as per your requirement without knowing your requirement?
The format code is somewhat explained in
Conventions for number and time formats ‒ QlikView
If you need help with creating the variable for the format, then please
- specify your format requirements
- post a small sample QVW with your current status, i.e. the input field and variable definition.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you soo much for your help.
I implemented your solution and honestly speaking you just nailed it.
I was actually looking for this solution only.
Thanks again for making my day.
Cheers
Ali
