Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
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.
Desired output
Follow , the below steps inorder to obtain the desired output.
CLASS Function
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.
Replace
Edit the calculated dimension as -->
Syntax: Replace([field],'what you want to replace','what should be replaced')
Output :
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.
DUAL
Edit the calculated dimension as -->
Output:
You can now observe that Sales range is ordered accordingly and Count of sales can be observed easily by seeing the above table.
Final Output:-
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,
Thanks for sharing.
I would also suggest you to attach the qvw file also for people to explore this on there own.
Best,
Sunny