Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
s_santalucia
Partner - Creator
Partner - Creator

Create QVD file and sum of measurement

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.

4 Replies
kenphamvn
Creator III
Creator III

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

s_santalucia
Partner - Creator
Partner - Creator
Author

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.

Anonymous
Not applicable

Personally I tend to do things like this in the QVD generator script.

  • The QVD fields / values become a single version of the truth that can be used in multiple qvf apps
  • Less processing is needed in the qvf app which should mean better performance
s_santalucia
Partner - Creator
Partner - Creator
Author

Thank you for you help!