Documents for QlikView related information.
I would like to discuss about CLASS,REPLACE,DUAL functions in qlikview. I will explain these functions by taking a sample business scenario.
U Can observe that for different Sale Id we have different Sale Amount. Now, Our requirement is that our organization wants to organize all the sales based on range.
Follow , the below steps inorder to obtain the desired output.
syntax:- Class([Desired field],range)
The output obtained is,
Now, if you want to remove '<= x <' symbols in between the numbers, u can use replace function.
Edit the calculated dimension as -->
Syntax: Replace([field],'what you want to replace','what should be replaced')
U can , now observe that '<= x <' is replaced with '-'.
However, you can see that range values are not sorted correctly . To, rearrange them in a proper order with equi range distribution You can use DUAL function.
You can now observe that Sales range is ordered accordingly and Count of sales can be observed easily by seeing the above table.
Note: I dn't want to see those sales which are not in range. so,I have checked, Supress Null Values i.e why u can't see 600-700 ,800-900,.....2200-2300 in Sales range column .
Thanks & Regards,
Good Information and thanks for this post.
The reason behind sorting issue after using Replace is..
1) Class function will provide output in dual, so you can sort the values according to numeric format.
2) But once you are using Replace function to remove <= x <, the whole expression/calculated dimension converted to string/text format because Replace is a string function and will return Text or String.
3) Using Dual will make the whole expression/calculated dimension back to dual format.
good Job. i will definitetly use this
Great.Does it work same way in script as well!!!
I would even advise to mainly / only use these functions in script and not in the front-end. Not doing it in the front-end is way better for performance.
Yes, U can
Good article.. its useful for me...
Thank you for good information.
Thank you Bharat! Good Job.