Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

error message when creating expression on crosstable

Hello,

I have the following error message when I add an expression in my graph : "You have attempted to apply a numerical expression, which is not uniquely defined for the specified variable. In order to use this variable in expressions relying on number of occurrences, please read it a second time under a new name from its primary table."

error.jpg

This is what I wish to make:

- Import a crossed table (cf example below, and associated script)

- To create a line chart (sum on all the projects), with in dimension the date

After import data, I create a new chart, select 'line chart', the dimension 'date' and the expression Sum(myData). The error appears if I choose 'Sum' and ' myData ' in the drop-down lists, but there is no error if I write directly the expression. However, it does not generate the expected graph.

What is the good approach ?

Thank you in advance !

Vincent

---------------------------------------------------------------------------------------------------------------------------------

Here are the test data :

project01/01/201202/01/201203/01/201204/01/201205/01/201206/01/201207/01/201208/01/201209/01/201210/01/201211/01/201212/01/201213/01/2012
p11000000000000
p20000006000000
p30000005000000
p40000000100000
p50000010010400
p60011000000000
p70000010010300
p80000000000000
p900001000003200
p100010055010009
p11000650000000880
p120000000005000
p130660000000000
p140000000000000
p150000000000000

Here is the script generated for the import of the Excel file :

CrossTable(date, myData)

LOAD project,

     40909,

     40910,

     40911,

     40912,

     40913,

     40914,

     40915,

     40916,

     40917,

     40918,

     40919,

     40920,

     40921

FROM

D:\Temp\Classeur2.xlsx

(ooxml, embedded labels, table is Feuil1);

PS: I saw that the discussion n°146856 treated with the same subject, but finally has no answer...

PPS : For french search in this forum :), the error message is "Vous avez tenté d'appliquer une expression numérique qui n'est pas définie de façon unique pour la variable concernée. Afin d'utiliser cette variable dans des expressions basées sur le nombre d'occurences, rechargez-la sous un nouveau nom à partir de sa table principale."

1 Solution

Accepted Solutions
Not applicable
Author

Some actions I noticed :

  1) when I use * instead of the explicit columns names in script :

      => crosstable dates are better recognised and data are correct (but when I keep automatic creation script, with column names, data are wrong)

           

screenshot2.jpg

  2) with XLSX (or XLSM) files (Excel 2007), date cells are not correctly imported (date is only correct when it is text cell).

      => But in Excel 2003, it's ok with classic date format (not all date formats).

screenshot.jpg

Is it a bug with QlikView ?

I will post a new question...

View solution in original post

8 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

attach is an example hope it helps you

Not applicable
Author

Thanks for your file, but I can't open it, I don't have licence for QlikView, so i can only open my own files...

Can you explain in a few words what you did in this file ?

Thanks !

Vincent

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

Try to use this code. I am able to create the line chart and it is working fine.

T1:

CrossTable(Date, Data)

LOAD *

FROM

[Classeur2(1).xlsx]

(ooxml, embedded labels, table is Feuil2);

Not applicable
Author

Sorry, i always have the same problem when i select "Sum" in drop-down lists. And when i copy-past "Sum(Data)" in script window, i have this chart :

graph.jpg

which is incorrect :

  - date are not date format

  - value max should be 88 and not 1 500 000 !!

I don't understand what happen...

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

First Create the cross table. Then again load it resident and change date format to (DD-MM-YYYY) or whatever format you need. The date problem will get solved. The null value is appearing because some how your excel have some data without any date. please check that.

T1:

CrossTable(Date_test, Data)

LOAD *

FROM

[Classeur2(1).xlsx]

(ooxml, embedded labels, table is Feuil2);

T2:

Noconcatenate

Load

Project,

Date(Date_test,'DD-MM-YYYY') as Date_test,

Data

Resident T1;

Drop Table T1;

Hope this will help.

Not applicable
Author

Hi,

I tried but conversion is not ok. Date are always like '40896' instead of '19/12/2012'.

But when i save the xlsm file in xls (=Excel 2003), it's ok (date at good format, data corrects, graph ok) !

So I think it's a problem of conversion / compatibility with Excel 2007, date are not recognised well and data are wrong.

If anybody have another advice... i take it !

instead, i will try to convert with old Excel, but not very usefull for me...

Vincent

Not applicable
Author

Some actions I noticed :

  1) when I use * instead of the explicit columns names in script :

      => crosstable dates are better recognised and data are correct (but when I keep automatic creation script, with column names, data are wrong)

           

screenshot2.jpg

  2) with XLSX (or XLSM) files (Excel 2007), date cells are not correctly imported (date is only correct when it is text cell).

      => But in Excel 2003, it's ok with classic date format (not all date formats).

screenshot.jpg

Is it a bug with QlikView ?

I will post a new question...

Not applicable
Author

This script give me good date with xlsx file (cf post 99797) :

T1:

CrossTable(date, myData)

LOAD *

FROM

D:\Temp\Classeur1.xlsx

(ooxml, embedded labels, table is Feuil1, filters(

Remove(Row, Pos(Top, 17)),

Remove(Col, Pos(Top, 15))

));

T2:

LOAD *,

Date(Num(Evaluate(date))) as "date_ok"

Resident T1;

DROP TABLE T1;