Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to achieve the max of the Program using Maxstring(). It works for most of the projects. but for this scenario it gives an incorrect output.
Expected Output is B2700.18
But the output showing in the QV chart is B2700.8.
Is there any way I can fix this issue.
Hi,
Is the field always going to have a number after the point. If so you can try subfield(ID,'.',2) as ID_Order and use this the get the max number.
Kind Regards
Kamiel
Excel has the same behaviour , because alphabetically 14,17,18 comes before 2
maybe you can prepare your data appending a '0' before numbers with only one char
Maybe using KeepChar(ID,'0123456789.') could sort in a way you need
Hi Kamiel,
The subfield works good if we are having a number after the decimal. i.e B2700.2, B2700.3
but I also have the data which has the value it self i.e B2700.
Can you help me on how this works.
Thanks,
SP
Hi,
While using this logic,
I would have an issue as I would also have numbers before the decimal as well,
Is there any other way to approach this?
Thanks,
SP
Try sorting on subfield(ID, '.', 1) & num(subfield(ID, '.', 2) / 1000, '.0000')
You can add this as a column to your chart to test.
Maxstring is correctly sorting alphabetically.
This will work (I'm unable to edit the previous reply)
subfield(ID, '.', 1) & num(subfield(ID, '.', 2) / 100, '.00')
This partially works but modifies the initial data from B2700.18 to B27000.18
You can get the desire result based on inbuilt sorting function'Sort'i n QlikView ,You just need to transform data as i.e 2700.18, 2700.18 and put it one variable then use it variable in Sort section .
Hope it will works...