Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have a question for you:
I created a QVD file from csv file; then I did a sum of measurement to reduce a number of record .
I have to add a "if conditions" to create subgroups.
for example:
I have AGE (in year) and I have to create age classes (0-10 --> 1st class) ecc....
Should I group together when I create QVDs or when I do the SUM?ù
Thanks.
Hi
you can using Qlik Class function or If condition to create subgroups
Example
Using Class
[Sheet1]:
LOAD class([Age],10,' Age ') as AgeGroup,
count([ID]) as countnum
FROM [lib://Desktop/TestClass.xlsx]
(ooxml, embedded labels, table is Sheet1)
group by class([Age],10,' Age ') ;
Using If condition
[Sheet1]:
LOAD
if([Age] <=10, '1 to 10'
,if ([Age] <=20, '11 to 20'
,if ([Age] <=30, '21 to 30', 'Above 30'))) as AgeGroup
,count([ID]) as countnum
FROM [lib://Desktop/TestClass.xlsx]
(ooxml, embedded labels, table is Sheet1)
group by
if([Age] <=10, '1 to 10'
,if ([Age] <=20, '11 to 20'
,if ([Age] <=30, '21 to 30', 'Above 30')));
Regads
An Pham
Hi,
thank you for your help.
I have another question:
this conditions (if and class) that you give me, from a technical point of view, is it better to use them when I create qvd or when I add up?
Thanks.
Personally I tend to do things like this in the QVD generator script.
Thank you for you help!